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

Side by Side Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 376213002: DevTools: Make FrameConsole methods accept ConsoleMessage objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@scriptFailedToParse
Patch Set: Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 22 matching lines...) Expand all
33 #include "bindings/core/v8/ScriptSourceCode.h" 33 #include "bindings/core/v8/ScriptSourceCode.h"
34 #include "bindings/core/v8/ScriptValue.h" 34 #include "bindings/core/v8/ScriptValue.h"
35 #include "core/dom/ActiveDOMObject.h" 35 #include "core/dom/ActiveDOMObject.h"
36 #include "core/dom/AddConsoleMessageTask.h" 36 #include "core/dom/AddConsoleMessageTask.h"
37 #include "core/dom/ContextLifecycleNotifier.h" 37 #include "core/dom/ContextLifecycleNotifier.h"
38 #include "core/dom/DOMURL.h" 38 #include "core/dom/DOMURL.h"
39 #include "core/dom/ExceptionCode.h" 39 #include "core/dom/ExceptionCode.h"
40 #include "core/dom/MessagePort.h" 40 #include "core/dom/MessagePort.h"
41 #include "core/events/ErrorEvent.h" 41 #include "core/events/ErrorEvent.h"
42 #include "core/events/Event.h" 42 #include "core/events/Event.h"
43 #include "core/inspector/ConsoleMessage.h"
43 #include "core/inspector/InspectorConsoleInstrumentation.h" 44 #include "core/inspector/InspectorConsoleInstrumentation.h"
44 #include "core/inspector/ScriptCallStack.h" 45 #include "core/inspector/ScriptCallStack.h"
45 #include "core/inspector/WorkerInspectorController.h" 46 #include "core/inspector/WorkerInspectorController.h"
46 #include "core/loader/WorkerThreadableLoader.h" 47 #include "core/loader/WorkerThreadableLoader.h"
47 #include "core/frame/LocalDOMWindow.h" 48 #include "core/frame/LocalDOMWindow.h"
48 #include "core/workers/WorkerNavigator.h" 49 #include "core/workers/WorkerNavigator.h"
49 #include "core/workers/WorkerClients.h" 50 #include "core/workers/WorkerClients.h"
50 #include "core/workers/WorkerConsole.h" 51 #include "core/workers/WorkerConsole.h"
51 #include "core/workers/WorkerLocation.h" 52 #include "core/workers/WorkerLocation.h"
52 #include "core/workers/WorkerNavigator.h" 53 #include "core/workers/WorkerNavigator.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 postTask(AddConsoleMessageTask::create(source, level, message)); 292 postTask(AddConsoleMessageTask::create(source, level, message));
292 return; 293 return;
293 } 294 }
294 thread()->workerReportingProxy().reportConsoleMessage(source, level, message , lineNumber, sourceURL); 295 thread()->workerReportingProxy().reportConsoleMessage(source, level, message , lineNumber, sourceURL);
295 addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, nul lptr, scriptState); 296 addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, nul lptr, scriptState);
296 } 297 }
297 298
298 void WorkerGlobalScope::addMessageToWorkerConsole(MessageSource source, MessageL evel level, const String& message, const String& sourceURL, unsigned lineNumber, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, ScriptState* scriptState) 299 void WorkerGlobalScope::addMessageToWorkerConsole(MessageSource source, MessageL evel level, const String& message, const String& sourceURL, unsigned lineNumber, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, ScriptState* scriptState)
299 { 300 {
300 ASSERT(isContextThread()); 301 ASSERT(isContextThread());
301 if (callStack) 302 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(source, level , message, sourceURL, lineNumber);
302 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy pe, level, message, callStack); 303 consoleMessage->setCallStack(callStack);
303 else 304 consoleMessage->setScriptState(scriptState);
304 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy pe, level, message, sourceURL, lineNumber, 0, scriptState); 305 InspectorInstrumentation::addMessageToConsole(this, consoleMessage);
305 } 306 }
306 307
307 bool WorkerGlobalScope::isContextThread() const 308 bool WorkerGlobalScope::isContextThread() const
308 { 309 {
309 return thread()->isCurrentThread(); 310 return thread()->isCurrentThread();
310 } 311 }
311 312
312 bool WorkerGlobalScope::isJSExecutionForbidden() const 313 bool WorkerGlobalScope::isJSExecutionForbidden() const
313 { 314 {
314 return m_script->isExecutionForbidden(); 315 return m_script->isExecutionForbidden();
(...skipping 25 matching lines...) Expand all
340 visitor->trace(m_location); 341 visitor->trace(m_location);
341 visitor->trace(m_navigator); 342 visitor->trace(m_navigator);
342 visitor->trace(m_eventQueue); 343 visitor->trace(m_eventQueue);
343 visitor->trace(m_workerClients); 344 visitor->trace(m_workerClients);
344 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); 345 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor);
345 ExecutionContext::trace(visitor); 346 ExecutionContext::trace(visitor);
346 EventTargetWithInlineData::trace(visitor); 347 EventTargetWithInlineData::trace(visitor);
347 } 348 }
348 349
349 } // namespace blink 350 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698