| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 m_agents.append(InspectorProfilerAgent::create(MainThreadDebugger::instance(
)->debugger(), m_overlay.get())); | 478 m_agents.append(InspectorProfilerAgent::create(MainThreadDebugger::instance(
)->debugger(), m_overlay.get())); |
| 479 m_agents.append(InspectorHeapProfilerAgent::create(isolate, m_pageRuntimeAge
nt->v8Agent())); | 479 m_agents.append(InspectorHeapProfilerAgent::create(isolate, m_pageRuntimeAge
nt->v8Agent())); |
| 480 | 480 |
| 481 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea
te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent))
; | 481 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea
te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent))
; |
| 482 m_pageAgent = pageAgentPtr.get(); | 482 m_pageAgent = pageAgentPtr.get(); |
| 483 m_agents.append(pageAgentPtr.release()); | 483 m_agents.append(pageAgentPtr.release()); |
| 484 | 484 |
| 485 m_pageConsoleAgent->setDebuggerAgent(debuggerAgent->v8Agent()); | 485 m_pageConsoleAgent->setDebuggerAgent(debuggerAgent->v8Agent()); |
| 486 | 486 |
| 487 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons
oleAgent::clearAllMessages, m_pageConsoleAgent.get())); | 487 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons
oleAgent::clearAllMessages, m_pageConsoleAgent.get())); |
| 488 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassRefPtr<prot
ocol::TypeBuilder::Runtime::RemoteObject>, PassRefPtr<JSONObject>>(&InspectorIns
pectorAgent::inspect, m_inspectorAgent.get())); | 488 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassOwnPtr<prot
ocol::Runtime::RemoteObject>, PassRefPtr<JSONObject>>(&InspectorInspectorAgent::
inspect, m_inspectorAgent.get())); |
| 489 | 489 |
| 490 if (m_overlay) | 490 if (m_overlay) |
| 491 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get()); | 491 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get()); |
| 492 } | 492 } |
| 493 | 493 |
| 494 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent>
agent) | 494 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent>
agent) |
| 495 { | 495 { |
| 496 m_agents.append(agent); | 496 m_agents.append(agent); |
| 497 } | 497 } |
| 498 | 498 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 return; | 648 return; |
| 649 flushPendingProtocolNotifications(); | 649 flushPendingProtocolNotifications(); |
| 650 String stateToSend; | 650 String stateToSend; |
| 651 if (!m_stateMuted) { | 651 if (!m_stateMuted) { |
| 652 stateToSend = m_agents.state(); | 652 stateToSend = m_agents.state(); |
| 653 if (stateToSend == m_stateCookie) | 653 if (stateToSend == m_stateCookie) |
| 654 stateToSend = String(); | 654 stateToSend = String(); |
| 655 else | 655 else |
| 656 m_stateCookie = stateToSend; | 656 m_stateCookie = stateToSend; |
| 657 } | 657 } |
| 658 |
| 658 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st
ateToSend); | 659 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st
ateToSend); |
| 659 } | 660 } |
| 660 | 661 |
| 661 void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<JSONObject> messa
ge) | 662 void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<JSONObject> messa
ge) |
| 662 { | 663 { |
| 663 if (!m_attached) | 664 if (!m_attached) |
| 664 return; | 665 return; |
| 665 m_notificationQueue.append(std::make_pair(m_sessionId, message)); | 666 m_notificationQueue.append(std::make_pair(m_sessionId, message)); |
| 666 } | 667 } |
| 667 | 668 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 678 // Otherwise, pass to the client (embedded workers do it differently). | 679 // Otherwise, pass to the client (embedded workers do it differently). |
| 679 m_client->resumeStartup(); | 680 m_client->resumeStartup(); |
| 680 } | 681 } |
| 681 | 682 |
| 682 void WebDevToolsAgentImpl::pageLayoutInvalidated() | 683 void WebDevToolsAgentImpl::pageLayoutInvalidated() |
| 683 { | 684 { |
| 684 if (m_overlay) | 685 if (m_overlay) |
| 685 m_overlay->pageLayoutInvalidated(); | 686 m_overlay->pageLayoutInvalidated(); |
| 686 } | 687 } |
| 687 | 688 |
| 688 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String* message) | 689 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String& message) |
| 689 { | 690 { |
| 690 if (m_overlay) | 691 if (m_overlay) |
| 691 m_overlay->setPausedInDebuggerMessage(message); | 692 m_overlay->setPausedInDebuggerMessage(message); |
| 692 } | 693 } |
| 693 | 694 |
| 694 void WebDevToolsAgentImpl::waitForCreateWindow(LocalFrame* frame) | 695 void WebDevToolsAgentImpl::waitForCreateWindow(LocalFrame* frame) |
| 695 { | 696 { |
| 696 if (!m_attached) | 697 if (!m_attached) |
| 697 return; | 698 return; |
| 698 if (m_client->requestDevToolsForFrame(WebLocalFrameImpl::fromFrame(frame))) | 699 if (m_client->requestDevToolsForFrame(WebLocalFrameImpl::fromFrame(frame))) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor); | 746 OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor); |
| 746 OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(sessionId, descriptor.
release())); | 747 OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(sessionId, descriptor.
release())); |
| 747 MainThreadDebugger::interruptMainThreadAndRun(task.release()); | 748 MainThreadDebugger::interruptMainThreadAndRun(task.release()); |
| 748 } | 749 } |
| 749 | 750 |
| 750 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) | 751 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) |
| 751 { | 752 { |
| 752 String commandName; | 753 String commandName; |
| 753 if (!protocol::Dispatcher::getCommandName(message, &commandName)) | 754 if (!protocol::Dispatcher::getCommandName(message, &commandName)) |
| 754 return false; | 755 return false; |
| 755 return commandName == protocol::Dispatcher::commandName(protocol::Dispatcher
::kDebugger_pauseCmd) | 756 return commandName == "Debugger.pause" |
| 756 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher
::kDebugger_setBreakpointCmd) | 757 || commandName == "Debugger.setBreakpoint" |
| 757 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher
::kDebugger_setBreakpointByUrlCmd) | 758 || commandName == "Debugger.setBreakpointByUrl" |
| 758 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher
::kDebugger_removeBreakpointCmd) | 759 || commandName == "Debugger.removeBreakpoint" |
| 759 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher
::kDebugger_setBreakpointsActiveCmd); | 760 || commandName == "Debugger.setBreakpointsActive"; |
| 760 } | 761 } |
| 761 | 762 |
| 762 } // namespace blink | 763 } // namespace blink |
| OLD | NEW |