| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 return; | 268 return; |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 } | 271 } |
| 272 | 272 |
| 273 EventTarget* WorkerGlobalScope::errorEventTarget() | 273 EventTarget* WorkerGlobalScope::errorEventTarget() |
| 274 { | 274 { |
| 275 return this; | 275 return this; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void WorkerGlobalScope::logExceptionToConsole(const String& errorMessage, const
String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scri
ptCallStack>) | 278 void WorkerGlobalScope::logExceptionToConsole(PassRefPtrWillBeRawPtr<ConsoleMess
age> consoleError) |
| 279 { | 279 { |
| 280 thread()->workerReportingProxy().reportException(errorMessage, lineNumber, c
olumnNumber, sourceURL); | 280 thread()->workerReportingProxy().reportException(consoleError); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void WorkerGlobalScope::reportBlockedScriptExecutionToInspector(const String& di
rectiveText) | 283 void WorkerGlobalScope::reportBlockedScriptExecutionToInspector(const String& di
rectiveText) |
| 284 { | 284 { |
| 285 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); | 285 InspectorInstrumentation::scriptExecutionBlockedByCSP(this, directiveText); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void WorkerGlobalScope::addMessage(MessageSource source, MessageLevel level, con
st String& message, const String& sourceURL, unsigned lineNumber, ScriptState* s
criptState) | 288 void WorkerGlobalScope::addMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> consol
eError) |
| 289 { | 289 { |
| 290 if (!isContextThread()) { | 290 if (!isContextThread()) { |
| 291 postTask(AddConsoleMessageTask::create(source, level, message)); | 291 postTask(AddConsoleMessageTask::create(consoleError->source(), consoleEr
ror->level(), consoleError->message())); |
| 292 return; | 292 return; |
| 293 } | 293 } |
| 294 thread()->workerReportingProxy().reportConsoleMessage(source, level, message
, lineNumber, sourceURL); | 294 thread()->workerReportingProxy().reportConsoleMessage(consoleError->source()
, consoleError->level(), consoleError->message(), consoleError->lineNumber(), co
nsoleError->url()); |
| 295 addMessageToWorkerConsole(source, level, message, sourceURL, lineNumber, nul
lptr, scriptState); | 295 addMessageToWorkerConsole(consoleError); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void WorkerGlobalScope::addMessageToWorkerConsole(MessageSource source, MessageL
evel level, const String& message, const String& sourceURL, unsigned lineNumber,
PassRefPtrWillBeRawPtr<ScriptCallStack> callStack, ScriptState* scriptState) | 298 void WorkerGlobalScope::addMessageToWorkerConsole(PassRefPtrWillBeRawPtr<Console
Message> consoleError) |
| 299 { | 299 { |
| 300 ASSERT(isContextThread()); | 300 ASSERT(isContextThread()); |
| 301 if (callStack) | 301 InspectorInstrumentation::addMessageToConsole(this, consoleError); |
| 302 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, callStack); | |
| 303 else | |
| 304 InspectorInstrumentation::addMessageToConsole(this, source, LogMessageTy
pe, level, message, sourceURL, lineNumber, 0, scriptState); | |
| 305 } | 302 } |
| 306 | 303 |
| 307 bool WorkerGlobalScope::isContextThread() const | 304 bool WorkerGlobalScope::isContextThread() const |
| 308 { | 305 { |
| 309 return thread()->isCurrentThread(); | 306 return thread()->isCurrentThread(); |
| 310 } | 307 } |
| 311 | 308 |
| 312 bool WorkerGlobalScope::isJSExecutionForbidden() const | 309 bool WorkerGlobalScope::isJSExecutionForbidden() const |
| 313 { | 310 { |
| 314 return m_script->isExecutionForbidden(); | 311 return m_script->isExecutionForbidden(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 340 visitor->trace(m_location); | 337 visitor->trace(m_location); |
| 341 visitor->trace(m_navigator); | 338 visitor->trace(m_navigator); |
| 342 visitor->trace(m_eventQueue); | 339 visitor->trace(m_eventQueue); |
| 343 visitor->trace(m_workerClients); | 340 visitor->trace(m_workerClients); |
| 344 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); | 341 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); |
| 345 ExecutionContext::trace(visitor); | 342 ExecutionContext::trace(visitor); |
| 346 EventTargetWithInlineData::trace(visitor); | 343 EventTargetWithInlineData::trace(visitor); |
| 347 } | 344 } |
| 348 | 345 |
| 349 } // namespace WebCore | 346 } // namespace WebCore |
| OLD | NEW |