OLD | NEW |
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 Loading... |
243 | 243 |
244 // Notify proxy that a new WorkerGlobalScope has been created and starte
d. | 244 // Notify proxy that a new WorkerGlobalScope has been created and starte
d. |
245 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get(
)); | 245 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get(
)); |
246 | 246 |
247 WorkerScriptController* script = m_workerGlobalScope->script(); | 247 WorkerScriptController* script = m_workerGlobalScope->script(); |
248 if (!script->isExecutionForbidden()) | 248 if (!script->isExecutionForbidden()) |
249 script->initializeContextIfNeeded(); | 249 script->initializeContextIfNeeded(); |
250 } | 250 } |
251 m_workerGlobalScope->workerInspectorController()->workerContextInitialized(s
tartMode == PauseWorkerGlobalScopeOnStart); | 251 m_workerGlobalScope->workerInspectorController()->workerContextInitialized(s
tartMode == PauseWorkerGlobalScopeOnStart); |
252 | 252 |
253 if (m_workerGlobalScope->script()->scriptState()->contextIsValid()) { | |
254 m_workerReportingProxy.didInitializeWorkerContext(); | |
255 } | |
256 | |
257 OwnPtrWillBeRawPtr<CachedMetadataHandler> handler(workerGlobalScope()->creat
eWorkerScriptCachedMetadataHandler(scriptURL, cachedMetaData.get())); | 253 OwnPtrWillBeRawPtr<CachedMetadataHandler> handler(workerGlobalScope()->creat
eWorkerScriptCachedMetadataHandler(scriptURL, cachedMetaData.get())); |
258 bool success = m_workerGlobalScope->script()->evaluate(ScriptSourceCode(sour
ceCode, scriptURL), nullptr, handler.get(), v8CacheOptions); | 254 bool success = m_workerGlobalScope->script()->evaluate(ScriptSourceCode(sour
ceCode, scriptURL), nullptr, handler.get(), v8CacheOptions); |
259 m_workerGlobalScope->didEvaluateWorkerScript(); | 255 m_workerGlobalScope->didEvaluateWorkerScript(); |
260 m_workerReportingProxy.didEvaluateWorkerScript(success); | 256 m_workerReportingProxy.didEvaluateWorkerScript(success); |
261 | 257 |
262 postInitialize(); | 258 postInitialize(); |
263 | 259 |
264 m_webScheduler->postIdleTaskAfterWakeup(FROM_HERE, WTF::bind<double>(&Worker
Thread::performIdleWork, this)); | 260 m_webScheduler->postIdleTaskAfterWakeup(FROM_HERE, WTF::bind<double>(&Worker
Thread::performIdleWork, this)); |
265 } | 261 } |
266 | 262 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); | 507 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); |
512 } | 508 } |
513 | 509 |
514 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) | 510 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) |
515 { | 511 { |
516 MutexLocker locker(m_workerInspectorControllerMutex); | 512 MutexLocker locker(m_workerInspectorControllerMutex); |
517 m_workerInspectorController = workerInspectorController; | 513 m_workerInspectorController = workerInspectorController; |
518 } | 514 } |
519 | 515 |
520 } // namespace blink | 516 } // namespace blink |
OLD | NEW |