Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1264913002: [Extension ServiceWorkers] Blink: Passing v8::context to extensions dispatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes sage) 194 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes sage)
195 { 195 {
196 m_document.postInspectorTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWo rkerImpl::postMessageToPageInspector, &m_embeddedWorker, message)); 196 m_document.postInspectorTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWo rkerImpl::postMessageToPageInspector, &m_embeddedWorker, message));
197 } 197 }
198 198
199 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) 199 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success)
200 { 200 {
201 m_client.didEvaluateWorkerScript(success); 201 m_client.didEvaluateWorkerScript(success);
202 } 202 }
203 203
204 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext()
205 {
206 ASSERT(m_workerGlobalScope);
207 ScriptState::Scope scope(m_workerGlobalScope->script()->scriptState());
208 m_client.didInitializeWorkerContext(m_workerGlobalScope->script()->context() , WebURL(m_document.url()));
209 }
210
204 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope) 211 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope)
205 { 212 {
206 ASSERT(!m_workerGlobalScope); 213 ASSERT(!m_workerGlobalScope);
207 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe); 214 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco pe);
208 m_client.workerContextStarted(this); 215 m_client.workerContextStarted(this);
209 } 216 }
210 217
211 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() 218 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed()
212 { 219 {
213 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl: :terminateWorkerContext, &m_embeddedWorker)); 220 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl: :terminateWorkerContext, &m_embeddedWorker));
(...skipping 12 matching lines...) Expand all
226 233
227 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) 234 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client)
228 : m_embeddedWorker(embeddedWorker) 235 : m_embeddedWorker(embeddedWorker)
229 , m_document(document) 236 , m_document(document)
230 , m_client(client) 237 , m_client(client)
231 , m_workerGlobalScope(0) 238 , m_workerGlobalScope(0)
232 { 239 {
233 } 240 }
234 241
235 } // namespace blink 242 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698