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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) | 197 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) |
198 { | 198 { |
199 m_document.postInspectorTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWo
rkerImpl::postMessageToPageInspector, &m_embeddedWorker, message)); | 199 m_document.postInspectorTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWo
rkerImpl::postMessageToPageInspector, &m_embeddedWorker, message)); |
200 } | 200 } |
201 | 201 |
202 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) | 202 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) |
203 { | 203 { |
204 m_client.didEvaluateWorkerScript(success); | 204 m_client.didEvaluateWorkerScript(success); |
205 } | 205 } |
206 | 206 |
207 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() | |
208 { | |
209 ASSERT(m_workerGlobalScope); | |
210 ScriptState::Scope scope(m_workerGlobalScope->script()->scriptState()); | |
211 m_client.didInitializeWorkerContext(m_workerGlobalScope->script()->context()
, WebURL(m_document.url())); | |
212 } | |
213 | |
214 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope*
workerGlobalScope) | 207 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope*
workerGlobalScope) |
215 { | 208 { |
216 ASSERT(!m_workerGlobalScope); | 209 ASSERT(!m_workerGlobalScope); |
217 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); | 210 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); |
218 m_client.workerContextStarted(this); | 211 m_client.workerContextStarted(this); |
219 } | 212 } |
220 | 213 |
221 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() | 214 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() |
222 { | 215 { |
223 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl:
:terminateWorkerContext, &m_embeddedWorker)); | 216 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl:
:terminateWorkerContext, &m_embeddedWorker)); |
(...skipping 12 matching lines...) Expand all Loading... |
236 | 229 |
237 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 230 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
238 : m_embeddedWorker(embeddedWorker) | 231 : m_embeddedWorker(embeddedWorker) |
239 , m_document(document) | 232 , m_document(document) |
240 , m_client(client) | 233 , m_client(client) |
241 , m_workerGlobalScope(0) | 234 , m_workerGlobalScope(0) |
242 { | 235 { |
243 } | 236 } |
244 | 237 |
245 } // namespace blink | 238 } // namespace blink |
OLD | NEW |