Chromium Code Reviews| 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 m_agents.append(InspectorProfilerAgent::create(MainThreadDebugger::instance( )->debugger(), m_overlay.get())); | 483 m_agents.append(InspectorProfilerAgent::create(MainThreadDebugger::instance( )->debugger(), m_overlay.get())); |
| 484 m_agents.append(InspectorHeapProfilerAgent::create(isolate, m_pageRuntimeAge nt->v8Agent())); | 484 m_agents.append(InspectorHeapProfilerAgent::create(isolate, m_pageRuntimeAge nt->v8Agent())); |
| 485 | 485 |
| 486 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent)) ; | 486 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea te(m_inspectedFrames.get(), this, m_resourceContentLoader.get(), debuggerAgent)) ; |
| 487 m_pageAgent = pageAgentPtr.get(); | 487 m_pageAgent = pageAgentPtr.get(); |
| 488 m_agents.append(pageAgentPtr.release()); | 488 m_agents.append(pageAgentPtr.release()); |
| 489 | 489 |
| 490 m_pageConsoleAgent->setDebuggerAgent(debuggerAgent->v8Agent()); | 490 m_pageConsoleAgent->setDebuggerAgent(debuggerAgent->v8Agent()); |
| 491 | 491 |
| 492 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons oleAgent::clearAllMessages, m_pageConsoleAgent.get())); | 492 m_pageRuntimeAgent->v8Agent()->setClearConsoleCallback(bind<>(&InspectorCons oleAgent::clearAllMessages, m_pageConsoleAgent.get())); |
| 493 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassRefPtr<prot ocol::TypeBuilder::Runtime::RemoteObject>, PassRefPtr<JSONObject>>(&InspectorIns pectorAgent::inspect, m_inspectorAgent.get())); | 493 m_pageRuntimeAgent->v8Agent()->setInspectObjectCallback(bind<PassOwnPtr<prot ocol::TypeBuilder::Runtime::RemoteObject>, PassRefPtr<JSONObject>>(&InspectorIns pectorAgent::inspect, m_inspectorAgent.get())); |
| 494 | 494 |
| 495 if (m_overlay) | 495 if (m_overlay) |
| 496 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get()); | 496 m_overlay->init(cssAgent, debuggerAgent, m_domAgent.get()); |
| 497 } | 497 } |
| 498 | 498 |
| 499 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent> agent) | 499 void WebDevToolsAgentImpl::registerAgent(PassOwnPtrWillBeRawPtr<InspectorAgent> agent) |
| 500 { | 500 { |
| 501 m_agents.append(agent); | 501 m_agents.append(agent); |
| 502 } | 502 } |
| 503 | 503 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 653 return; | 653 return; |
| 654 flushPendingProtocolNotifications(); | 654 flushPendingProtocolNotifications(); |
| 655 String stateToSend; | 655 String stateToSend; |
| 656 if (!m_stateMuted) { | 656 if (!m_stateMuted) { |
| 657 stateToSend = m_agents.state(); | 657 stateToSend = m_agents.state(); |
| 658 if (stateToSend == m_stateCookie) | 658 if (stateToSend == m_stateCookie) |
| 659 stateToSend = String(); | 659 stateToSend = String(); |
| 660 else | 660 else |
| 661 m_stateCookie = stateToSend; | 661 m_stateCookie = stateToSend; |
| 662 } | 662 } |
| 663 | |
| 663 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st ateToSend); | 664 m_client->sendProtocolMessage(sessionId, callId, message->toJSONString(), st ateToSend); |
| 664 } | 665 } |
| 665 | 666 |
| 666 void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<JSONObject> messa ge) | 667 void WebDevToolsAgentImpl::sendProtocolNotification(PassRefPtr<JSONObject> messa ge) |
| 667 { | 668 { |
| 668 if (!m_attached) | 669 if (!m_attached) |
| 669 return; | 670 return; |
| 670 m_notificationQueue.append(std::make_pair(m_sessionId, message)); | 671 m_notificationQueue.append(std::make_pair(m_sessionId, message)); |
| 671 } | 672 } |
| 672 | 673 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 683 // Otherwise, pass to the client (embedded workers do it differently). | 684 // Otherwise, pass to the client (embedded workers do it differently). |
| 684 m_client->resumeStartup(); | 685 m_client->resumeStartup(); |
| 685 } | 686 } |
| 686 | 687 |
| 687 void WebDevToolsAgentImpl::pageLayoutInvalidated() | 688 void WebDevToolsAgentImpl::pageLayoutInvalidated() |
| 688 { | 689 { |
| 689 if (m_overlay) | 690 if (m_overlay) |
| 690 m_overlay->pageLayoutInvalidated(); | 691 m_overlay->pageLayoutInvalidated(); |
| 691 } | 692 } |
| 692 | 693 |
| 693 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String* message) | 694 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String& message) |
| 694 { | 695 { |
| 695 if (m_overlay) | 696 if (m_overlay) |
| 696 m_overlay->setPausedInDebuggerMessage(message); | 697 m_overlay->setPausedInDebuggerMessage(message); |
| 697 } | 698 } |
| 698 | 699 |
| 699 void WebDevToolsAgentImpl::waitForCreateWindow(LocalFrame* frame) | 700 void WebDevToolsAgentImpl::waitForCreateWindow(LocalFrame* frame) |
| 700 { | 701 { |
| 701 if (!m_attached) | 702 if (!m_attached) |
| 702 return; | 703 return; |
| 703 if (m_client->requestDevToolsForFrame(WebLocalFrameImpl::fromFrame(frame))) | 704 if (m_client->requestDevToolsForFrame(WebLocalFrameImpl::fromFrame(frame))) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 750 OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor); | 751 OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor); |
| 751 OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(sessionId, descriptor. release())); | 752 OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(sessionId, descriptor. release())); |
| 752 MainThreadDebugger::interruptMainThreadAndRun(task.release()); | 753 MainThreadDebugger::interruptMainThreadAndRun(task.release()); |
| 753 } | 754 } |
| 754 | 755 |
| 755 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) | 756 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) |
| 756 { | 757 { |
| 757 String commandName; | 758 String commandName; |
| 758 if (!protocol::Dispatcher::getCommandName(message, &commandName)) | 759 if (!protocol::Dispatcher::getCommandName(message, &commandName)) |
| 759 return false; | 760 return false; |
| 760 return commandName == protocol::Dispatcher::commandName(protocol::Dispatcher ::kDebugger_pauseCmd) | 761 return commandName == "Debugger.pause" |
| 761 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher ::kDebugger_setBreakpointCmd) | 762 || commandName == "Debugger.setBreakpointCmd" |
|
dgozman
2016/02/22 23:57:36
kill Cmd
| |
| 762 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher ::kDebugger_setBreakpointByUrlCmd) | 763 || commandName == "Debugger.setBreakpointByUrlCmd" |
| 763 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher ::kDebugger_removeBreakpointCmd) | 764 || commandName == "Debugger.removeBreakpointCmd" |
| 764 || commandName == protocol::Dispatcher::commandName(protocol::Dispatcher ::kDebugger_setBreakpointsActiveCmd); | 765 || commandName == "Debugger.setBreakpointsActiveCmd"; |
| 765 } | 766 } |
| 766 | 767 |
| 767 } // namespace blink | 768 } // namespace blink |
| OLD | NEW |