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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) | 79 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) |
80 { | 80 { |
81 ASSERT(m_workerGlobalScope); | 81 ASSERT(m_workerGlobalScope); |
82 | 82 |
83 OwnPtr<MessagePortArray> ports = MessagePort::toMessagePortArray(m_workerGlo
balScope, webChannels); | 83 OwnPtr<MessagePortArray> ports = MessagePort::toMessagePortArray(m_workerGlo
balScope, webChannels); |
84 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); | 84 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); |
85 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val
ue)); | 85 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val
ue)); |
86 } | 86 } |
87 | 87 |
| 88 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID) |
| 89 { |
| 90 ASSERT(m_workerGlobalScope); |
| 91 m_workerGlobalScope->dispatchEvent(Event::create(EventTypeNames::sync)); |
| 92 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSyncEven
t(eventID); |
| 93 } |
| 94 |
88 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage,
int lineNumber, int columnNumber, const String& sourceURL) | 95 void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage,
int lineNumber, int columnNumber, const String& sourceURL) |
89 { | 96 { |
90 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); | 97 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); |
91 } | 98 } |
92 | 99 |
93 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(MessageSource, MessageL
evel, const String& message, int lineNumber, const String& sourceURL) | 100 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(MessageSource, MessageL
evel, const String& message, int lineNumber, const String& sourceURL) |
94 { | 101 { |
95 notImplemented(); | 102 notImplemented(); |
96 } | 103 } |
97 | 104 |
(...skipping 27 matching lines...) Expand all Loading... |
125 | 132 |
126 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC
lient& client) | 133 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, ExecutionContext& executionContext, WebServiceWorkerContextC
lient& client) |
127 : m_embeddedWorker(embeddedWorker) | 134 : m_embeddedWorker(embeddedWorker) |
128 , m_executionContext(executionContext) | 135 , m_executionContext(executionContext) |
129 , m_client(client) | 136 , m_client(client) |
130 , m_workerGlobalScope(0) | 137 , m_workerGlobalScope(0) |
131 { | 138 { |
132 } | 139 } |
133 | 140 |
134 } // namespace blink | 141 } // namespace blink |
OLD | NEW |