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

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

Issue 206073005: PassRefPtr is stolen by first agent invocation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: chmod Created 6 years, 9 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 m_frontend = frontend->console(); 150 m_frontend = frontend->console();
151 } 151 }
152 152
153 void InspectorConsoleAgent::clearFrontend() 153 void InspectorConsoleAgent::clearFrontend()
154 { 154 {
155 m_frontend = 0; 155 m_frontend = 0;
156 String errorString; 156 String errorString;
157 disable(&errorString); 157 disable(&errorString);
158 } 158 }
159 159
160 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp e type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> c allStack, unsigned long requestIdentifier) 160 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp e type, MessageLevel level, const String& message, ScriptCallStack* callStack, u nsigned long requestIdentifier)
161 { 161 {
162 if (type == ClearMessageType) { 162 if (type == ClearMessageType) {
163 ErrorString error; 163 ErrorString error;
164 clearMessages(&error); 164 clearMessages(&error);
165 } 165 }
166 166
167 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type , level, message, callStack, requestIdentifier))); 167 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type , level, message, callStack, requestIdentifier)));
168 } 168 }
169 169
170 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp e type, MessageLevel level, const String& message, ScriptState* state, PassRefPt r<ScriptArguments> arguments, unsigned long requestIdentifier) 170 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp e type, MessageLevel level, const String& message, ScriptState* state, ScriptArg uments* arguments, unsigned long requestIdentifier)
171 { 171 {
172 if (type == ClearMessageType) { 172 if (type == ClearMessageType) {
173 ErrorString error; 173 ErrorString error;
174 clearMessages(&error); 174 clearMessages(&error);
175 } 175 }
176 176
177 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type , level, message, arguments, state, requestIdentifier))); 177 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type , level, message, arguments, state, requestIdentifier)));
178 } 178 }
179 179
180 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp e type, MessageLevel level, const String& message, const String& scriptId, unsig ned lineNumber, unsigned columnNumber, ScriptState* state, unsigned long request Identifier) 180 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp e type, MessageLevel level, const String& message, const String& scriptId, unsig ned lineNumber, unsigned columnNumber, ScriptState* state, unsigned long request Identifier)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 const ScriptCallFrame& lastCaller = callStack->at(0); 241 const ScriptCallFrame& lastCaller = callStack->at(0);
242 // Follow Firebug's behavior of counting with null and undefined title in 242 // Follow Firebug's behavior of counting with null and undefined title in
243 // the same bucket as no argument 243 // the same bucket as no argument
244 String title; 244 String title;
245 arguments->getFirstArgumentAsString(title); 245 arguments->getFirstArgumentAsString(title);
246 String identifier = title.isEmpty() ? String(lastCaller.sourceURL() + ':' + String::number(lastCaller.lineNumber())) 246 String identifier = title.isEmpty() ? String(lastCaller.sourceURL() + ':' + String::number(lastCaller.lineNumber()))
247 : String(title + '@'); 247 : String(title + '@');
248 248
249 HashCountedSet<String>::AddResult result = m_counts.add(identifier); 249 HashCountedSet<String>::AddResult result = m_counts.add(identifier);
250 String message = title + ": " + String::number(result.storedValue->value); 250 String message = title + ": " + String::number(result.storedValue->value);
251 addMessageToConsole(ConsoleAPIMessageSource, LogMessageType, DebugMessageLev el, message, callStack); 251 addMessageToConsole(ConsoleAPIMessageSource, LogMessageType, DebugMessageLev el, message, callStack.get());
aandrey 2014/03/24 14:59:39 nit: get() -> release()
252 } 252 }
253 253
254 void InspectorConsoleAgent::frameWindowDiscarded(DOMWindow* window) 254 void InspectorConsoleAgent::frameWindowDiscarded(DOMWindow* window)
255 { 255 {
256 size_t messageCount = m_consoleMessages.size(); 256 size_t messageCount = m_consoleMessages.size();
257 for (size_t i = 0; i < messageCount; ++i) 257 for (size_t i = 0; i < messageCount; ++i)
258 m_consoleMessages[i]->windowCleared(window); 258 m_consoleMessages[i]->windowCleared(window);
259 m_injectedScriptManager->discardInjectedScriptsFor(window); 259 m_injectedScriptManager->discardInjectedScriptsFor(window);
260 } 260 }
261 261
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 int m_heapObjectId; 341 int m_heapObjectId;
342 }; 342 };
343 343
344 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe apObjectId) 344 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe apObjectId)
345 { 345 {
346 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n ew InspectableHeapObject(inspectedHeapObjectId))); 346 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n ew InspectableHeapObject(inspectedHeapObjectId)));
347 } 347 }
348 348
349 } // namespace WebCore 349 } // namespace WebCore
350 350
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorConsoleAgent.h ('k') | Source/core/inspector/InspectorDebuggerAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698