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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "web/WebDevToolsAgentImpl.h" | 32 #include "web/WebDevToolsAgentImpl.h" |
33 | 33 |
34 #include "InspectorBackendDispatcher.h" | 34 #include "InspectorBackendDispatcher.h" |
35 #include "InspectorFrontend.h" | 35 #include "InspectorFrontend.h" |
36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
| 37 #include "bindings/dart/DartScriptDebugServer.h" |
37 #include "bindings/v8/PageScriptDebugServer.h" | 38 #include "bindings/v8/PageScriptDebugServer.h" |
38 #include "bindings/v8/ScriptController.h" | 39 #include "bindings/v8/ScriptController.h" |
39 #include "bindings/common/DeleteResult.h" | 40 #include "bindings/common/DeleteResult.h" |
40 #include "core/dom/ExceptionCode.h" | 41 #include "core/dom/ExceptionCode.h" |
41 #include "core/fetch/MemoryCache.h" | 42 #include "core/fetch/MemoryCache.h" |
42 #include "core/frame/FrameView.h" | 43 #include "core/frame/FrameView.h" |
43 #include "core/frame/LocalFrame.h" | 44 #include "core/frame/LocalFrame.h" |
44 #include "core/frame/Settings.h" | 45 #include "core/frame/Settings.h" |
45 #include "core/inspector/InjectedScriptHost.h" | 46 #include "core/inspector/InjectedScriptHost.h" |
46 #include "core/inspector/InspectorController.h" | 47 #include "core/inspector/InspectorController.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 namespace blink { | 84 namespace blink { |
84 | 85 |
85 class ClientMessageLoopAdapter : public PageScriptDebugServer::ClientMessageLoop
{ | 86 class ClientMessageLoopAdapter : public PageScriptDebugServer::ClientMessageLoop
{ |
86 public: | 87 public: |
87 static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) | 88 static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) |
88 { | 89 { |
89 if (s_instance) | 90 if (s_instance) |
90 return; | 91 return; |
91 OwnPtr<ClientMessageLoopAdapter> instance = adoptPtr(new ClientMessageLo
opAdapter(adoptPtr(client->createClientMessageLoop()))); | 92 OwnPtr<ClientMessageLoopAdapter> instance = adoptPtr(new ClientMessageLo
opAdapter(adoptPtr(client->createClientMessageLoop()))); |
92 s_instance = instance.get(); | 93 s_instance = instance.get(); |
| 94 // FIXMEDART: cleanup memory model. |
| 95 DartScriptDebugServer::shared().setClientMessageLoop(s_instance); |
93 PageScriptDebugServer::shared().setClientMessageLoop(instance.release())
; | 96 PageScriptDebugServer::shared().setClientMessageLoop(instance.release())
; |
94 } | 97 } |
95 | 98 |
96 static void inspectedViewClosed(WebViewImpl* view) | 99 static void inspectedViewClosed(WebViewImpl* view) |
97 { | 100 { |
98 if (s_instance) | 101 if (s_instance) |
99 s_instance->m_frozenViews.remove(view); | 102 s_instance->m_frozenViews.remove(view); |
100 } | 103 } |
101 | 104 |
102 static void didNavigate() | 105 static void didNavigate() |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 ic->didProcessTask(); | 682 ic->didProcessTask(); |
680 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Program"); | 683 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Program"); |
681 flushPendingFrontendMessages(); | 684 flushPendingFrontendMessages(); |
682 } | 685 } |
683 | 686 |
684 void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* rawDescriptor) | 687 void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* rawDescriptor) |
685 { | 688 { |
686 // rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a Web
Kit API function. | 689 // rawDescriptor can't be a PassOwnPtr because interruptAndDispatch is a Web
Kit API function. |
687 OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor); | 690 OwnPtr<MessageDescriptor> descriptor = adoptPtr(rawDescriptor); |
688 OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(descriptor.release()))
; | 691 OwnPtr<DebuggerTask> task = adoptPtr(new DebuggerTask(descriptor.release()))
; |
| 692 // FIXMEDART: do we need to support Dart as well? |
689 PageScriptDebugServer::interruptAndRun(task.release()); | 693 PageScriptDebugServer::interruptAndRun(task.release()); |
690 } | 694 } |
691 | 695 |
692 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) | 696 bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) |
693 { | 697 { |
694 String commandName; | 698 String commandName; |
695 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) | 699 if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) |
696 return false; | 700 return false; |
697 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) | 701 return commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_pauseCmd) |
698 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) | 702 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointCmd) |
699 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) | 703 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointByUrlCmd) |
700 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 704 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
701 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 705 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
702 } | 706 } |
703 | 707 |
704 void WebDevToolsAgent::processPendingMessages() | 708 void WebDevToolsAgent::processPendingMessages() |
705 { | 709 { |
706 PageScriptDebugServer::shared().runPendingTasks(); | 710 PageScriptDebugServer::shared().runPendingTasks(); |
707 } | 711 } |
708 | 712 |
709 } // namespace blink | 713 } // namespace blink |
OLD | NEW |