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

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

Issue 383063008: Expose the ServiceWorker's v8 context to embedders. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Don't #include .cpp files. :-P Created 6 years, 5 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 { 162 {
163 ASSERT(m_webView); 163 ASSERT(m_webView);
164 164
165 // Detach the client before closing the view to avoid getting called back. 165 // Detach the client before closing the view to avoid getting called back.
166 toWebLocalFrameImpl(m_mainFrame)->setClient(0); 166 toWebLocalFrameImpl(m_mainFrame)->setClient(0);
167 167
168 m_webView->close(); 168 m_webView->close();
169 m_mainFrame->close(); 169 m_mainFrame->close();
170 } 170 }
171 171
172 void WebEmbeddedWorkerImpl::postTask(PassOwnPtr<ExecutionContextTask> task)
173 {
174 // We don't propagate the bool return because |true| doesn't mean the task w ill be run.
175 m_workerThread->runLoop().postTask(task);
176 }
177
172 void WebEmbeddedWorkerImpl::startWorkerContext( 178 void WebEmbeddedWorkerImpl::startWorkerContext(
173 const WebEmbeddedWorkerStartData& data) 179 const WebEmbeddedWorkerStartData& data)
174 { 180 {
175 ASSERT(!m_askedToTerminate); 181 ASSERT(!m_askedToTerminate);
176 ASSERT(!m_mainScriptLoader); 182 ASSERT(!m_mainScriptLoader);
177 ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload); 183 ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload);
178 m_workerStartData = data; 184 m_workerStartData = data;
179 if (data.pauseAfterDownloadMode == WebEmbeddedWorkerStartData::PauseAfterDow nload) 185 if (data.pauseAfterDownloadMode == WebEmbeddedWorkerStartData::PauseAfterDow nload)
180 m_pauseAfterDownloadState = DoPauseAfterDownload; 186 m_pauseAfterDownloadState = DoPauseAfterDownload;
181 prepareShadowPageForLoader(); 187 prepareShadowPageForLoader();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 m_mainScriptLoader.clear(); 365 m_mainScriptLoader.clear();
360 366
361 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); 367 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient);
362 m_loaderProxy = LoaderProxy::create(*this); 368 m_loaderProxy = LoaderProxy::create(*this);
363 369
364 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); 370 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release());
365 m_workerThread->start(); 371 m_workerThread->start();
366 } 372 }
367 373
368 } // namespace blink 374 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698