OLD | NEW |
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 Loading... |
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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 postTask(AddConsoleMessageTask::create(source, level, message)); | 298 postTask(AddConsoleMessageTask::create(source, level, message)); |
298 return; | 299 return; |
299 } | 300 } |
300 thread()->workerReportingProxy().reportConsoleMessage(source, level, message
, lineNumber, sourceURL); | 301 thread()->workerReportingProxy().reportConsoleMessage(source, level, message
, lineNumber, sourceURL); |
301 addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, nul
lptr, scriptState); | 302 addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, nul
lptr, scriptState); |
302 } | 303 } |
303 | 304 |
304 void WorkerGlobalScope::addMessageToWorkerConsole(MessageSource source, MessageL
evel level, const String& message, const String& sourceURL, unsigned lineNumber,
PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, ScriptState* scriptState) | 305 void WorkerGlobalScope::addMessageToWorkerConsole(MessageSource source, MessageL
evel level, const String& message, const String& sourceURL, unsigned lineNumber,
PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, ScriptState* scriptState) |
305 { | 306 { |
306 ASSERT(isContextThread()); | 307 ASSERT(isContextThread()); |
307 if (callStack) | 308 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(source, level
, message, sourceURL, lineNumber); |
308 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, callStack); | 309 consoleMessage->setCallStack(callStack); |
309 else | 310 consoleMessage->setScriptState(scriptState); |
310 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, sourceURL, lineNumber, 0, scriptState); | 311 InspectorInstrumentation::addMessageToConsole(this, consoleMessage.get()); |
311 } | 312 } |
312 | 313 |
313 bool WorkerGlobalScope::isContextThread() const | 314 bool WorkerGlobalScope::isContextThread() const |
314 { | 315 { |
315 return thread()->isCurrentThread(); | 316 return thread()->isCurrentThread(); |
316 } | 317 } |
317 | 318 |
318 bool WorkerGlobalScope::isJSExecutionForbidden() const | 319 bool WorkerGlobalScope::isJSExecutionForbidden() const |
319 { | 320 { |
320 return m_script->isExecutionForbidden(); | 321 return m_script->isExecutionForbidden(); |
(...skipping 26 matching lines...) Expand all Loading... |
347 visitor->trace(m_navigator); | 348 visitor->trace(m_navigator); |
348 visitor->trace(m_workerInspectorController); | 349 visitor->trace(m_workerInspectorController); |
349 visitor->trace(m_eventQueue); | 350 visitor->trace(m_eventQueue); |
350 visitor->trace(m_workerClients); | 351 visitor->trace(m_workerClients); |
351 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); | 352 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); |
352 ExecutionContext::trace(visitor); | 353 ExecutionContext::trace(visitor); |
353 EventTargetWithInlineData::trace(visitor); | 354 EventTargetWithInlineData::trace(visitor); |
354 } | 355 } |
355 | 356 |
356 } // namespace blink | 357 } // namespace blink |
OLD | NEW |