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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 void WorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const
String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scri
ptCallStack>) | 285 void WorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const
String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scri
ptCallStack>) |
286 { | 286 { |
287 thread()->workerReportingProxy().reportException(errorMessage, lineNumber, c
olumnNumber, sourceURL); | 287 thread()->workerReportingProxy().reportException(errorMessage, lineNumber, c
olumnNumber, sourceURL); |
288 } | 288 } |
289 | 289 |
290 void WorkerGlobalScope::reportBlockedScriptExecutionToInspector(const String& di
rectiveText) | 290 void WorkerGlobalScope::reportBlockedScriptExecutionToInspector(const String& di
rectiveText) |
291 { | 291 { |
292 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); | 292 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); |
293 } | 293 } |
294 | 294 |
295 void WorkerGlobalScope::addMessage(MessageSource source, MessageLevel level, con
st String& message, const String& sourceURL, unsigned lineNumber, ScriptState* s
criptState) | 295 void WorkerGlobalScope::addMessage(PassRefPtr<ConsoleMessage> prpConsoleMessage) |
296 { | 296 { |
| 297 RefPtr<ConsoleMessage> consoleMessage = prpConsoleMessage; |
297 if (!isContextThread()) { | 298 if (!isContextThread()) { |
298 postTask(AddConsoleMessageTask::create(source, level, message)); | 299 postTask(AddConsoleMessageTask::create(consoleMessage->source(), console
Message->level(), consoleMessage->message())); |
299 return; | 300 return; |
300 } | 301 } |
301 thread()->workerReportingProxy().reportConsoleMessage(source, level, message
, lineNumber, sourceURL); | 302 thread()->workerReportingProxy().reportConsoleMessage(consoleMessage); |
302 addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, nul
lptr, scriptState); | 303 addMessageToWorkerConsole(consoleMessage.release()); |
303 } | 304 } |
304 | 305 |
305 void WorkerGlobalScope::addMessageToWorkerConsole(MessageSource source, MessageL
evel level, const String& message, const String& sourceURL, unsigned lineNumber,
PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, ScriptState* scriptState) | 306 void WorkerGlobalScope::addMessageToWorkerConsole(PassRefPtr<ConsoleMessage> con
soleMessage) |
306 { | 307 { |
307 ASSERT(isContextThread()); | 308 ASSERT(isContextThread()); |
308 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(s
ource, level, message, sourceURL, lineNumber); | |
309 consoleMessage->setCallStack(callStack); | |
310 consoleMessage->setScriptState(scriptState); | |
311 InspectorInstrumentation::addMessageToConsole(this, consoleMessage.get()); | 309 InspectorInstrumentation::addMessageToConsole(this, consoleMessage.get()); |
312 } | 310 } |
313 | 311 |
314 bool WorkerGlobalScope::isContextThread() const | 312 bool WorkerGlobalScope::isContextThread() const |
315 { | 313 { |
316 return thread()->isCurrentThread(); | 314 return thread()->isCurrentThread(); |
317 } | 315 } |
318 | 316 |
319 bool WorkerGlobalScope::isJSExecutionForbidden() const | 317 bool WorkerGlobalScope::isJSExecutionForbidden() const |
320 { | 318 { |
(...skipping 27 matching lines...) Expand all Loading... |
348 visitor->trace(m_navigator); | 346 visitor->trace(m_navigator); |
349 visitor->trace(m_workerInspectorController); | 347 visitor->trace(m_workerInspectorController); |
350 visitor->trace(m_eventQueue); | 348 visitor->trace(m_eventQueue); |
351 visitor->trace(m_workerClients); | 349 visitor->trace(m_workerClients); |
352 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); | 350 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); |
353 ExecutionContext::trace(visitor); | 351 ExecutionContext::trace(visitor); |
354 EventTargetWithInlineData::trace(visitor); | 352 EventTargetWithInlineData::trace(visitor); |
355 } | 353 } |
356 | 354 |
357 } // namespace blink | 355 } // namespace blink |
OLD | NEW |