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())); | |
kinuko
2015/08/14 01:37:34
KURL m_document.url() is not thread safe, I suspec
annekao
2015/08/14 19:44:23
Done.
| |
212 } | |
213 | |
207 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope) | 214 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope) |
208 { | 215 { |
209 ASSERT(!m_workerGlobalScope); | 216 ASSERT(!m_workerGlobalScope); |
210 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe); | 217 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe); |
211 m_client.workerContextStarted(this); | 218 m_client.workerContextStarted(this); |
212 } | 219 } |
213 | 220 |
214 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() | 221 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() |
215 { | 222 { |
216 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl: :terminateWorkerContext, &m_embeddedWorker)); | 223 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl: :terminateWorkerContext, &m_embeddedWorker)); |
(...skipping 12 matching lines...) Expand all Loading... | |
229 | 236 |
230 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 237 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
231 : m_embeddedWorker(embeddedWorker) | 238 : m_embeddedWorker(embeddedWorker) |
232 , m_document(document) | 239 , m_document(document) |
233 , m_client(client) | 240 , m_client(client) |
234 , m_workerGlobalScope(0) | 241 , m_workerGlobalScope(0) |
235 { | 242 { |
236 } | 243 } |
237 | 244 |
238 } // namespace blink | 245 } // namespace blink |
OLD | NEW |