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

Side by Side Diff: Source/core/workers/WorkerThread.cpp

Issue 270873005: Initializes the context of WorkerScriptController before calling willEvaluateWorkerScript. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add isExecutionForbidden check Created 6 years, 7 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
« no previous file with comments | « Source/bindings/v8/WorkerScriptController.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 } 122 }
123 // The corresponding call to didStopWorkerRunLoop is in 123 // The corresponding call to didStopWorkerRunLoop is in
124 // ~WorkerScriptController. 124 // ~WorkerScriptController.
125 blink::Platform::current()->didStartWorkerRunLoop(blink::WebWorkerRunLoop(&m _runLoop)); 125 blink::Platform::current()->didStartWorkerRunLoop(blink::WebWorkerRunLoop(&m _runLoop));
126 126
127 // Notify proxy that a new WorkerGlobalScope has been created and started. 127 // Notify proxy that a new WorkerGlobalScope has been created and started.
128 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get()); 128 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get());
129 129
130 WorkerScriptController* script = m_workerGlobalScope->script(); 130 WorkerScriptController* script = m_workerGlobalScope->script();
131 if (!script->isExecutionForbidden())
132 script->initializeContextIfNeeded();
131 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star tMode); 133 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star tMode);
132 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); 134 script->evaluate(ScriptSourceCode(sourceCode, scriptURL));
133 135
134 runEventLoop(); 136 runEventLoop();
135 137
136 // This should be called before we start the shutdown procedure. 138 // This should be called before we start the shutdown procedure.
137 workerReportingProxy().willDestroyWorkerGlobalScope(); 139 workerReportingProxy().willDestroyWorkerGlobalScope();
138 140
139 ThreadIdentifier threadID = m_threadID; 141 ThreadIdentifier threadID = m_threadID;
140 142
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 240 }
239 m_runLoop.terminate(); 241 m_runLoop.terminate();
240 } 242 }
241 243
242 bool WorkerThread::isCurrentThread() const 244 bool WorkerThread::isCurrentThread() const
243 { 245 {
244 return m_threadID == currentThread(); 246 return m_threadID == currentThread();
245 } 247 }
246 248
247 } // namespace WebCore 249 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/WorkerScriptController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698