| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea
te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent))
; | 480 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea
te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent))
; |
| 481 m_pageAgent = pageAgentPtr.get(); | 481 m_pageAgent = pageAgentPtr.get(); |
| 482 m_agents.append(pageAgentPtr.release()); | 482 m_agents.append(pageAgentPtr.release()); |
| 483 | 483 |
| 484 OwnPtrWillBeRawPtr<PageConsoleAgent> pageConsoleAgentPtr = PageConsoleAgent:
:create(m_pageRuntimeAgent->v8Agent(), debuggerAgent->v8Agent(), m_domAgent, m_i
nspectedFrames.get()); | 484 OwnPtrWillBeRawPtr<PageConsoleAgent> pageConsoleAgentPtr = PageConsoleAgent:
:create(m_pageRuntimeAgent->v8Agent(), debuggerAgent->v8Agent(), m_domAgent, m_i
nspectedFrames.get()); |
| 485 m_pageConsoleAgent = pageConsoleAgentPtr.get(); | 485 m_pageConsoleAgent = pageConsoleAgentPtr.get(); |
| 486 m_agents.append(pageConsoleAgentPtr.release()); | 486 m_agents.append(pageConsoleAgentPtr.release()); |
| 487 | 487 |
| 488 m_workerAgent->setPageConsoleAgent(m_pageConsoleAgent); | 488 m_workerAgent->setPageConsoleAgent(m_pageConsoleAgent); |
| 489 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons
oleAgent::clearAllMessages, m_pageConsoleAgent.get())); | 489 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons
oleAgent::clearAllMessages, m_pageConsoleAgent.get())); |
| 490 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassOwnPtr<prot
ocol::Runtime::RemoteObject>, PassRefPtr<protocol::DictionaryValue>>(&InspectorI
nspectorAgent::inspect, m_inspectorAgent.get())); | 490 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassOwnPtr<prot
ocol::Runtime::RemoteObject>, PassOwnPtr<protocol::DictionaryValue>>(&InspectorI
nspectorAgent::inspect, m_inspectorAgent.get())); |
| 491 | 491 |
| 492 if (m_overlay) | 492 if (m_overlay) |
| 493 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get()); | 493 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get()); |
| 494 } | 494 } |
| 495 | 495 |
| 496 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent>
agent) | 496 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent>
agent) |
| 497 { | 497 { |
| 498 m_agents.append(agent); | 498 m_agents.append(agent); |
| 499 } | 499 } |
| 500 | 500 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 if (!node && m_webLocalFrameImpl->frame()->document()) | 643 if (!node && m_webLocalFrameImpl->frame()->document()) |
| 644 node = m_webLocalFrameImpl->frame()->document()->documentElement(); | 644 node = m_webLocalFrameImpl->frame()->document()->documentElement(); |
| 645 m_domAgent->inspect(node); | 645 m_domAgent->inspect(node); |
| 646 } | 646 } |
| 647 | 647 |
| 648 void WebDevToolsAgentImpl::failedToRequestDevTools() | 648 void WebDevToolsAgentImpl::failedToRequestDevTools() |
| 649 { | 649 { |
| 650 ClientMessageLoopAdapter::resumeForCreateWindow(); | 650 ClientMessageLoopAdapter::resumeForCreateWindow(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 void WebDevToolsAgentImpl::sendProtocolResponse(int sessionId, int callId, PassR
efPtr<protocol::DictionaryValue> message) | 653 void WebDevToolsAgentImpl::sendProtocolResponse(int sessionId, int callId, PassO
wnPtr<protocol::DictionaryValue> message) |
| 654 { | 654 { |
| 655 if (!m_attached) | 655 if (!m_attached) |
| 656 return; | 656 return; |
| 657 flushPendingProtocolNotifications(); | 657 flushPendingProtocolNotifications(); |
| 658 String stateToSend; | 658 String stateToSend; |
| 659 if (!m_stateMuted) { | 659 if (!m_stateMuted) { |
| 660 stateToSend = m_agents.state(); | 660 stateToSend = m_agents.state(); |
| 661 if (stateToSend == m_stateCookie) | 661 if (stateToSend == m_stateCookie) |
| 662 stateToSend = String(); | 662 stateToSend = String(); |
| 663 else | 663 else |
| 664 m_stateCookie = stateToSend; | 664 m_stateCookie = stateToSend; |
| 665 } | 665 } |
| 666 | 666 |
| 667 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st
ateToSend); | 667 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st
ateToSend); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<protocol::Diction
aryValue> message) | 670 void WebDevToolsAgentImpl::sendProtocolNotification(PassOwnPtr<protocol::Diction
aryValue> message) |
| 671 { | 671 { |
| 672 if (!m_attached) | 672 if (!m_attached) |
| 673 return; | 673 return; |
| 674 m_notificationQueue.append(std::make_pair(m_sessionId, message)); | 674 m_notificationQueue.append(std::make_pair(m_sessionId, message)); |
| 675 } | 675 } |
| 676 | 676 |
| 677 void WebDevToolsAgentImpl::flush() | 677 void WebDevToolsAgentImpl::flush() |
| 678 { | 678 { |
| 679 flushPendingProtocolNotifications(); | 679 flushPendingProtocolNotifications(); |
| 680 } | 680 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 if (!protocol::Dispatcher::getCommandName(message, &commandName)) | 767 if (!protocol::Dispatcher::getCommandName(message, &commandName)) |
| 768 return false; | 768 return false; |
| 769 return commandName == "Debugger.pause" | 769 return commandName == "Debugger.pause" |
| 770 || commandName == "Debugger.setBreakpoint" | 770 || commandName == "Debugger.setBreakpoint" |
| 771 || commandName == "Debugger.setBreakpointByUrl" | 771 || commandName == "Debugger.setBreakpointByUrl" |
| 772 || commandName == "Debugger.removeBreakpoint" | 772 || commandName == "Debugger.removeBreakpoint" |
| 773 || commandName == "Debugger.setBreakpointsActive"; | 773 || commandName == "Debugger.setBreakpointsActive"; |
| 774 } | 774 } |
| 775 | 775 |
| 776 } // namespace blink | 776 } // namespace blink |
| OLD | NEW |