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

Side by Side Diff: Source/bindings/core/v8/MainThreadDebugger.cpp

Issue 1225763002: Remove debugger id, use local frame id instead. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
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::setContextDebugData(v8::Local<v8::Context> context, con st String& type, LocalFrame* frame)
101 { 101 {
102 String debugData = "[" + type + "," + String::number(contextDebugId) + "]"; 102 LocalFrame* localFrameRoot = frame->localFrameRoot();
103 String debugData = "[" + type + "," + String::number(WeakIdentifierMap<Local Frame>::identifier(localFrameRoot)) + "]";
103 V8Debugger::setContextDebugData(context, debugData); 104 V8Debugger::setContextDebugData(context, debugData);
104 } 105 }
105 106
106 void MainThreadDebugger::addListener(ScriptDebugListener* listener, LocalFrame* localFrameRoot, int contextDebugId) 107 void MainThreadDebugger::addListener(ScriptDebugListener* listener, LocalFrame* localFrameRoot)
107 { 108 {
108 ASSERT(localFrameRoot == localFrameRoot->localFrameRoot()); 109 ASSERT(localFrameRoot == localFrameRoot->localFrameRoot());
109 110
110 ScriptController& scriptController = localFrameRoot->script(); 111 ScriptController& scriptController = localFrameRoot->script();
111 if (!scriptController.canExecuteScripts(NotAboutToExecuteScript)) 112 if (!scriptController.canExecuteScripts(NotAboutToExecuteScript))
112 return; 113 return;
113 114
114 if (m_listenersMap.isEmpty()) 115 if (m_listenersMap.isEmpty())
115 debugger()->enable(); 116 debugger()->enable();
116 m_listenersMap.set(localFrameRoot, listener); 117 m_listenersMap.set(localFrameRoot, listener);
117 String contextDataSubstring = "," + String::number(contextDebugId) + "]"; 118 String contextDataSubstring = "," + String::number(WeakIdentifierMap<LocalFr ame>::identifier(localFrameRoot)) + "]";
118 debugger()->reportCompiledScripts(contextDataSubstring, listener); 119 debugger()->reportCompiledScripts(contextDataSubstring, listener);
119 } 120 }
120 121
121 void MainThreadDebugger::removeListener(ScriptDebugListener* listener, LocalFram e* localFrame) 122 void MainThreadDebugger::removeListener(ScriptDebugListener* listener, LocalFram e* localFrame)
122 { 123 {
123 if (!m_listenersMap.contains(localFrame)) 124 if (!m_listenersMap.contains(localFrame))
124 return; 125 return;
125 126
126 if (m_pausedFrame == localFrame) 127 if (m_pausedFrame == localFrame)
127 debugger()->continueProgram(); 128 debugger()->continueProgram();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 170
170 m_pausedFrame = 0; 171 m_pausedFrame = 0;
171 } 172 }
172 173
173 void MainThreadDebugger::quitMessageLoopOnPause() 174 void MainThreadDebugger::quitMessageLoopOnPause()
174 { 175 {
175 m_clientMessageLoop->quitNow(); 176 m_clientMessageLoop->quitNow();
176 } 177 }
177 178
178 } // namespace blink 179 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698