OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "web/WebSharedWorkerImpl.h" | 32 #include "web/WebSharedWorkerImpl.h" |
33 | 33 |
34 #include "core/dom/CrossThreadTask.h" | 34 #include "core/dom/CrossThreadTask.h" |
35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
36 #include "core/events/MessageEvent.h" | 36 #include "core/events/MessageEvent.h" |
37 #include "core/html/HTMLFormElement.h" | 37 #include "core/html/HTMLFormElement.h" |
| 38 #include "core/inspector/ConsoleMessage.h" |
38 #include "core/inspector/InspectorInstrumentation.h" | 39 #include "core/inspector/InspectorInstrumentation.h" |
39 #include "core/inspector/WorkerDebuggerAgent.h" | 40 #include "core/inspector/WorkerDebuggerAgent.h" |
40 #include "core/inspector/WorkerInspectorController.h" | 41 #include "core/inspector/WorkerInspectorController.h" |
41 #include "core/loader/FrameLoadRequest.h" | 42 #include "core/loader/FrameLoadRequest.h" |
42 #include "core/loader/FrameLoader.h" | 43 #include "core/loader/FrameLoader.h" |
43 #include "core/page/Page.h" | 44 #include "core/page/Page.h" |
44 #include "core/workers/SharedWorkerGlobalScope.h" | 45 #include "core/workers/SharedWorkerGlobalScope.h" |
45 #include "core/workers/SharedWorkerThread.h" | 46 #include "core/workers/SharedWorkerThread.h" |
46 #include "core/workers/WorkerClients.h" | 47 #include "core/workers/WorkerClients.h" |
47 #include "core/workers/WorkerGlobalScope.h" | 48 #include "core/workers/WorkerGlobalScope.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); | 233 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); |
233 } | 234 } |
234 | 235 |
235 // WorkerReportingProxy -------------------------------------------------------- | 236 // WorkerReportingProxy -------------------------------------------------------- |
236 | 237 |
237 void WebSharedWorkerImpl::reportException(const String& errorMessage, int lineNu
mber, int columnNumber, const String& sourceURL) | 238 void WebSharedWorkerImpl::reportException(const String& errorMessage, int lineNu
mber, int columnNumber, const String& sourceURL) |
238 { | 239 { |
239 // Not suppported in SharedWorker. | 240 // Not suppported in SharedWorker. |
240 } | 241 } |
241 | 242 |
242 void WebSharedWorkerImpl::reportConsoleMessage(MessageSource source, MessageLeve
l level, const String& message, int lineNumber, const String& sourceURL) | 243 void WebSharedWorkerImpl::reportConsoleMessage(PassRefPtr<blink::ConsoleMessage>
) |
243 { | 244 { |
244 // Not supported in SharedWorker. | 245 // Not supported in SharedWorker. |
245 } | 246 } |
246 | 247 |
247 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) | 248 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) |
248 { | 249 { |
249 // Note that we need to keep the closure creation on a separate line so | 250 // Note that we need to keep the closure creation on a separate line so |
250 // that the temporary created by isolatedCopy() will always be destroyed | 251 // that the temporary created by isolatedCopy() will always be destroyed |
251 // before the copy in the closure is used on the main thread. | 252 // before the copy in the closure is used on the main thread. |
252 const Closure& boundFunction = bind(&WebSharedWorkerClient::dispatchDevTools
Message, m_clientWeakPtr, message.isolatedCopy()); | 253 const Closure& boundFunction = bind(&WebSharedWorkerClient::dispatchDevTools
Message, m_clientWeakPtr, message.isolatedCopy()); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 workerThread()->postDebuggerTask(createCrossThreadTask(dispatchOnInspectorBa
ckendTask, String(message))); | 449 workerThread()->postDebuggerTask(createCrossThreadTask(dispatchOnInspectorBa
ckendTask, String(message))); |
449 workerThread()->interruptAndDispatchInspectorCommands(); | 450 workerThread()->interruptAndDispatchInspectorCommands(); |
450 } | 451 } |
451 | 452 |
452 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 453 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
453 { | 454 { |
454 return new WebSharedWorkerImpl(client); | 455 return new WebSharedWorkerImpl(client); |
455 } | 456 } |
456 | 457 |
457 } // namespace blink | 458 } // namespace blink |
OLD | NEW |