Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp

Issue 1838523004: Initialize debugger together with isolate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed unnecessary assert hitting in unit tests Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/public/V8Debugger.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 17 matching lines...) Expand all
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 "web/WebDevToolsAgentImpl.h" 31 #include "web/WebDevToolsAgentImpl.h"
32 32
33 #include "bindings/core/v8/ScriptController.h" 33 #include "bindings/core/v8/ScriptController.h"
34 #include "bindings/core/v8/V8Binding.h" 34 #include "bindings/core/v8/V8Binding.h"
35 #include "core/frame/FrameView.h" 35 #include "core/frame/FrameView.h"
36 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
37 #include "core/frame/Settings.h" 37 #include "core/frame/Settings.h"
38 #include "core/inspector/IdentifiersFactory.h"
39 #include "core/inspector/InspectedFrames.h" 38 #include "core/inspector/InspectedFrames.h"
40 #include "core/inspector/InspectorAnimationAgent.h" 39 #include "core/inspector/InspectorAnimationAgent.h"
41 #include "core/inspector/InspectorApplicationCacheAgent.h" 40 #include "core/inspector/InspectorApplicationCacheAgent.h"
42 #include "core/inspector/InspectorCSSAgent.h" 41 #include "core/inspector/InspectorCSSAgent.h"
43 #include "core/inspector/InspectorDOMAgent.h" 42 #include "core/inspector/InspectorDOMAgent.h"
44 #include "core/inspector/InspectorDOMDebuggerAgent.h" 43 #include "core/inspector/InspectorDOMDebuggerAgent.h"
45 #include "core/inspector/InspectorDebuggerAgent.h" 44 #include "core/inspector/InspectorDebuggerAgent.h"
46 #include "core/inspector/InspectorHeapProfilerAgent.h" 45 #include "core/inspector/InspectorHeapProfilerAgent.h"
47 #include "core/inspector/InspectorInputAgent.h" 46 #include "core/inspector/InspectorInputAgent.h"
48 #include "core/inspector/InspectorInspectorAgent.h" 47 #include "core/inspector/InspectorInspectorAgent.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 { 105 {
107 s_instance = nullptr; 106 s_instance = nullptr;
108 } 107 }
109 108
110 static void ensureMainThreadDebuggerCreated(WebDevToolsAgentClient* client) 109 static void ensureMainThreadDebuggerCreated(WebDevToolsAgentClient* client)
111 { 110 {
112 if (s_instance) 111 if (s_instance)
113 return; 112 return;
114 OwnPtr<ClientMessageLoopAdapter> instance = adoptPtr(new ClientMessageLo opAdapter(adoptPtr(client->createClientMessageLoop()))); 113 OwnPtr<ClientMessageLoopAdapter> instance = adoptPtr(new ClientMessageLo opAdapter(adoptPtr(client->createClientMessageLoop())));
115 s_instance = instance.get(); 114 s_instance = instance.get();
116 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); 115 MainThreadDebugger::instance()->setClientMessageLoop(instance.release()) ;
117 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
118 data->setThreadDebugger(MainThreadDebugger::create(instance.release(), i solate));
119 } 116 }
120 117
121 static void webViewImplClosed(WebViewImpl* view) 118 static void webViewImplClosed(WebViewImpl* view)
122 { 119 {
123 if (s_instance) 120 if (s_instance)
124 s_instance->m_frozenViews.remove(view); 121 s_instance->m_frozenViews.remove(view);
125 } 122 }
126 123
127 static void webFrameWidgetImplClosed(WebFrameWidgetImpl* widget) 124 static void webFrameWidgetImplClosed(WebFrameWidgetImpl* widget)
128 { 125 {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 , m_pageRuntimeAgent(nullptr) 317 , m_pageRuntimeAgent(nullptr)
321 , m_pageConsoleAgent(nullptr) 318 , m_pageConsoleAgent(nullptr)
322 , m_agents(m_instrumentingAgents.get()) 319 , m_agents(m_instrumentingAgents.get())
323 , m_deferredAgentsInitialized(false) 320 , m_deferredAgentsInitialized(false)
324 , m_sessionId(0) 321 , m_sessionId(0)
325 , m_stateMuted(false) 322 , m_stateMuted(false)
326 { 323 {
327 ASSERT(isMainThread()); 324 ASSERT(isMainThread());
328 ASSERT(m_webLocalFrameImpl->frame()); 325 ASSERT(m_webLocalFrameImpl->frame());
329 326
330 long processId = Platform::current()->getUniqueIdForProcess();
331 ASSERT(processId > 0);
332 IdentifiersFactory::setProcessId(processId);
333
334 ClientMessageLoopAdapter::ensureMainThreadDebuggerCreated(m_client); 327 ClientMessageLoopAdapter::ensureMainThreadDebuggerCreated(m_client);
335 MainThreadDebugger* mainThreadDebugger = MainThreadDebugger::instance(); 328 MainThreadDebugger* mainThreadDebugger = MainThreadDebugger::instance();
336 329
337 OwnPtrWillBeRawPtr<InspectorInspectorAgent> inspectorAgentPtr(InspectorInspe ctorAgent::create()); 330 OwnPtrWillBeRawPtr<InspectorInspectorAgent> inspectorAgentPtr(InspectorInspe ctorAgent::create());
338 m_inspectorAgent = inspectorAgentPtr.get(); 331 m_inspectorAgent = inspectorAgentPtr.get();
339 m_agents.append(inspectorAgentPtr.release()); 332 m_agents.append(inspectorAgentPtr.release());
340 333
341 OwnPtrWillBeRawPtr<PageRuntimeAgent> pageRuntimeAgentPtr(PageRuntimeAgent::c reate(this, mainThreadDebugger->debugger(), m_inspectedFrames.get(), mainThreadD ebugger->contextGroupId(m_inspectedFrames->root()))); 334 OwnPtrWillBeRawPtr<PageRuntimeAgent> pageRuntimeAgentPtr(PageRuntimeAgent::c reate(this, mainThreadDebugger->debugger(), m_inspectedFrames.get(), mainThreadD ebugger->contextGroupId(m_inspectedFrames->root())));
342 m_pageRuntimeAgent = pageRuntimeAgentPtr.get(); 335 m_pageRuntimeAgent = pageRuntimeAgentPtr.get();
343 m_agents.append(pageRuntimeAgentPtr.release()); 336 m_agents.append(pageRuntimeAgentPtr.release());
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 if (!protocol::Dispatcher::getCommandName(message, &commandName)) 727 if (!protocol::Dispatcher::getCommandName(message, &commandName))
735 return false; 728 return false;
736 return commandName == "Debugger.pause" 729 return commandName == "Debugger.pause"
737 || commandName == "Debugger.setBreakpoint" 730 || commandName == "Debugger.setBreakpoint"
738 || commandName == "Debugger.setBreakpointByUrl" 731 || commandName == "Debugger.setBreakpointByUrl"
739 || commandName == "Debugger.removeBreakpoint" 732 || commandName == "Debugger.removeBreakpoint"
740 || commandName == "Debugger.setBreakpointsActive"; 733 || commandName == "Debugger.setBreakpointsActive";
741 } 734 }
742 735
743 } // namespace blink 736 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/public/V8Debugger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698