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

Side by Side Diff: Source/core/workers/WorkerThread.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: Removed v8::Context parameter 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 didStartRunLoop(); 243 didStartRunLoop();
244 244
245 // Notify proxy that a new WorkerGlobalScope has been created and started. 245 // Notify proxy that a new WorkerGlobalScope has been created and started.
246 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get()); 246 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get());
247 247
248 WorkerScriptController* script = m_workerGlobalScope->script(); 248 WorkerScriptController* script = m_workerGlobalScope->script();
249 if (!script->isExecutionForbidden()) 249 if (!script->isExecutionForbidden())
250 script->initializeContextIfNeeded(); 250 script->initializeContextIfNeeded();
251 m_workerGlobalScope->workerInspectorController()->workerContextInitialized(s tartMode == PauseWorkerGlobalScopeOnStart); 251 m_workerGlobalScope->workerInspectorController()->workerContextInitialized(s tartMode == PauseWorkerGlobalScopeOnStart);
252 252
253 if (script->scriptState()->contextIsValid()) {
dcheng 2015/08/05 00:04:53 How come we didn't need to check if the context wa
annekao 2015/08/05 16:43:02 I initially put this check in to address what falk
falken 2015/08/06 03:37:20 Hm, I was thinking of a different case, but it loo
254 m_workerReportingProxy.didInitializeWorkerContext();
255 }
256
253 OwnPtrWillBeRawPtr<CachedMetadataHandler> handler(workerGlobalScope()->creat eWorkerScriptCachedMetadataHandler(scriptURL, cachedMetaData.get())); 257 OwnPtrWillBeRawPtr<CachedMetadataHandler> handler(workerGlobalScope()->creat eWorkerScriptCachedMetadataHandler(scriptURL, cachedMetaData.get()));
254 bool success = script->evaluate(ScriptSourceCode(sourceCode, scriptURL), nul lptr, handler.get(), v8CacheOptions); 258 bool success = script->evaluate(ScriptSourceCode(sourceCode, scriptURL), nul lptr, handler.get(), v8CacheOptions);
255 m_workerGlobalScope->didEvaluateWorkerScript(); 259 m_workerGlobalScope->didEvaluateWorkerScript();
256 m_workerReportingProxy.didEvaluateWorkerScript(success); 260 m_workerReportingProxy.didEvaluateWorkerScript(success);
257 261
258 postInitialize(); 262 postInitialize();
259 263
260 m_webScheduler->postIdleTaskAfterWakeup(FROM_HERE, WTF::bind<double>(&Worker Thread::performIdleWork, this)); 264 m_webScheduler->postIdleTaskAfterWakeup(FROM_HERE, WTF::bind<double>(&Worker Thread::performIdleWork, this));
261 } 265 }
262 266
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); 511 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get());
508 } 512 }
509 513
510 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) 514 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController)
511 { 515 {
512 MutexLocker locker(m_workerInspectorControllerMutex); 516 MutexLocker locker(m_workerInspectorControllerMutex);
513 m_workerInspectorController = workerInspectorController; 517 m_workerInspectorController = workerInspectorController;
514 } 518 }
515 519
516 } // namespace blink 520 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698