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

Side by Side Diff: Source/core/inspector/MainThreadDebugger.cpp

Issue 1225763002: Remove debugger id, use local frame id instead. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/MainThreadDebugger.h ('k') | Source/core/inspector/PageDebuggerAgent.h » ('j') | 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) 2011 Google Inc. All rights reserved. 2 * Copyright (c) 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 DEFINE_TRACE(MainThreadDebugger) 91 DEFINE_TRACE(MainThreadDebugger)
92 { 92 {
93 #if ENABLE(OILPAN) 93 #if ENABLE(OILPAN)
94 visitor->trace(m_pausedFrame); 94 visitor->trace(m_pausedFrame);
95 visitor->trace(m_listenersMap); 95 visitor->trace(m_listenersMap);
96 #endif 96 #endif
97 ScriptDebuggerBase::trace(visitor); 97 ScriptDebuggerBase::trace(visitor);
98 } 98 }
99 99
100 void MainThreadDebugger::setContextDebugData(v8::Local<v8::Context> context, con st String& type, int contextDebugId) 100 void MainThreadDebugger::initializeContext(v8::Local<v8::Context> context, int w orldId)
101 { 101 {
102 String debugData = "[" + type + "," + String::number(contextDebugId) + "]"; 102 LocalFrame* frame = retrieveFrameWithGlobalObjectCheck(context);
103 if (!frame)
104 return;
105 LocalFrame* localFrameRoot = frame->localFrameRoot();
106 String type = worldId == MainWorldId ? "page" : "injected";
107 String debugData = "[" + type + "," + String::number(WeakIdentifierMap<Local Frame>::identifier(localFrameRoot)) + "]";
103 V8Debugger::setContextDebugData(context, debugData); 108 V8Debugger::setContextDebugData(context, debugData);
104 } 109 }
105 110
106 void MainThreadDebugger::addListener(ScriptDebugListener* listener, LocalFrame* localFrameRoot, int contextDebugId) 111 void MainThreadDebugger::addListener(ScriptDebugListener* listener, LocalFrame* localFrameRoot)
107 { 112 {
108 ASSERT(localFrameRoot == localFrameRoot->localFrameRoot()); 113 ASSERT(localFrameRoot == localFrameRoot->localFrameRoot());
109 114
110 ScriptController& scriptController = localFrameRoot->script(); 115 ScriptController& scriptController = localFrameRoot->script();
111 if (!scriptController.canExecuteScripts(NotAboutToExecuteScript)) 116 if (!scriptController.canExecuteScripts(NotAboutToExecuteScript))
112 return; 117 return;
113 118
114 if (m_listenersMap.isEmpty()) 119 if (m_listenersMap.isEmpty())
115 debugger()->enable(); 120 debugger()->enable();
116 m_listenersMap.set(localFrameRoot, listener); 121 m_listenersMap.set(localFrameRoot, listener);
117 String contextDataSubstring = "," + String::number(contextDebugId) + "]"; 122 String contextDataSubstring = "," + String::number(WeakIdentifierMap<LocalFr ame>::identifier(localFrameRoot)) + "]";
118 Vector<ScriptDebugListener::ParsedScript> compiledScripts; 123 Vector<ScriptDebugListener::ParsedScript> compiledScripts;
119 debugger()->getCompiledScripts(contextDataSubstring, compiledScripts); 124 debugger()->getCompiledScripts(contextDataSubstring, compiledScripts);
120 for (size_t i = 0; i < compiledScripts.size(); i++) 125 for (size_t i = 0; i < compiledScripts.size(); i++)
121 listener->didParseSource(compiledScripts[i]); 126 listener->didParseSource(compiledScripts[i]);
122 } 127 }
123 128
124 void MainThreadDebugger::removeListener(ScriptDebugListener* listener, LocalFram e* localFrame) 129 void MainThreadDebugger::removeListener(ScriptDebugListener* listener, LocalFram e* localFrame)
125 { 130 {
126 if (!m_listenersMap.contains(localFrame)) 131 if (!m_listenersMap.contains(localFrame))
127 return; 132 return;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 177
173 m_pausedFrame = 0; 178 m_pausedFrame = 0;
174 } 179 }
175 180
176 void MainThreadDebugger::quitMessageLoopOnPause() 181 void MainThreadDebugger::quitMessageLoopOnPause()
177 { 182 {
178 m_clientMessageLoop->quitNow(); 183 m_clientMessageLoop->quitNow();
179 } 184 }
180 185
181 } // namespace blink 186 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/MainThreadDebugger.h ('k') | Source/core/inspector/PageDebuggerAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698