OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "web/ServiceWorkerGlobalScopeProxy.h" | 32 #include "web/ServiceWorkerGlobalScopeProxy.h" |
33 | 33 |
34 #include "bindings/core/v8/WorkerScriptController.h" | 34 #include "bindings/core/v8/WorkerScriptController.h" |
35 #include "core/dom/CrossThreadTask.h" | 35 #include "core/dom/CrossThreadTask.h" |
36 #include "core/dom/ExecutionContext.h" | 36 #include "core/dom/ExecutionContext.h" |
37 #include "core/dom/MessagePort.h" | 37 #include "core/dom/MessagePort.h" |
38 #include "core/events/MessageEvent.h" | 38 #include "core/events/MessageEvent.h" |
| 39 #include "core/inspector/ConsoleMessage.h" |
39 #include "core/workers/WorkerGlobalScope.h" | 40 #include "core/workers/WorkerGlobalScope.h" |
40 #include "modules/push_messaging/PushEvent.h" | 41 #include "modules/push_messaging/PushEvent.h" |
41 #include "modules/serviceworkers/FetchEvent.h" | 42 #include "modules/serviceworkers/FetchEvent.h" |
42 #include "modules/serviceworkers/InstallEvent.h" | 43 #include "modules/serviceworkers/InstallEvent.h" |
43 #include "modules/serviceworkers/InstallPhaseEvent.h" | 44 #include "modules/serviceworkers/InstallPhaseEvent.h" |
44 #include "modules/serviceworkers/WaitUntilObserver.h" | 45 #include "modules/serviceworkers/WaitUntilObserver.h" |
45 #include "platform/NotImplemented.h" | 46 #include "platform/NotImplemented.h" |
46 #include "public/platform/WebServiceWorkerRequest.h" | 47 #include "public/platform/WebServiceWorkerRequest.h" |
47 #include "public/web/WebSerializedScriptValue.h" | 48 #include "public/web/WebSerializedScriptValue.h" |
48 #include "public/web/WebServiceWorkerContextClient.h" | 49 #include "public/web/WebServiceWorkerContextClient.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ASSERT(m_workerGlobalScope); | 113 ASSERT(m_workerGlobalScope); |
113 m_workerGlobalScope->dispatchEvent(Event::create(EventTypeNames::sync)); | 114 m_workerGlobalScope->dispatchEvent(Event::create(EventTypeNames::sync)); |
114 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSyncEven
t(eventID); | 115 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSyncEven
t(eventID); |
115 } | 116 } |
116 | 117 |
117 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage,
int lineNumber, int columnNumber, const String& sourceURL) | 118 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage,
int lineNumber, int columnNumber, const String& sourceURL) |
118 { | 119 { |
119 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); | 120 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); |
120 } | 121 } |
121 | 122 |
122 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(MessageSource source, M
essageLevel level, const String& message, int lineNumber, const String& sourceUR
L) | 123 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(PassRefPtr<blink::Conso
leMessage> consoleMessage) |
123 { | 124 { |
124 m_client.reportConsoleMessage(source, level, message, lineNumber, sourceURL)
; | 125 m_client.reportConsoleMessage(consoleMessage->source(), consoleMessage->leve
l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur
l()); |
125 } | 126 } |
126 | 127 |
127 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) | 128 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) |
128 { | 129 { |
129 m_client.dispatchDevToolsMessage(message); | 130 m_client.dispatchDevToolsMessage(message); |
130 } | 131 } |
131 | 132 |
132 void ServiceWorkerGlobalScopeProxy::updateInspectorStateCookie(const String& mes
sage) | 133 void ServiceWorkerGlobalScopeProxy::updateInspectorStateCookie(const String& mes
sage) |
133 { | 134 { |
134 m_client.saveDevToolsAgentState(message); | 135 m_client.saveDevToolsAgentState(message); |
(...skipping 24 matching lines...) Expand all Loading... |
159 | 160 |
160 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC
lient& client) | 161 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC
lient& client) |
161 : m_embeddedWorker(embeddedWorker) | 162 : m_embeddedWorker(embeddedWorker) |
162 , m_executionContext(executionContext) | 163 , m_executionContext(executionContext) |
163 , m_client(client) | 164 , m_client(client) |
164 , m_workerGlobalScope(0) | 165 , m_workerGlobalScope(0) |
165 { | 166 { |
166 } | 167 } |
167 | 168 |
168 } // namespace blink | 169 } // namespace blink |
OLD | NEW |