| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 if (!script->isExecutionForbidden()) | 318 if (!script->isExecutionForbidden()) |
| 319 script->initializeContextIfNeeded(); | 319 script->initializeContextIfNeeded(); |
| 320 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star
tMode); | 320 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star
tMode); |
| 321 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); | 321 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); |
| 322 | 322 |
| 323 postInitialize(); | 323 postInitialize(); |
| 324 | 324 |
| 325 postDelayedTask(createSameThreadTask(&WorkerThread::idleHandler, this), kSho
rtIdleHandlerDelayMs); | 325 postDelayedTask(createSameThreadTask(&WorkerThread::idleHandler, this), kSho
rtIdleHandlerDelayMs); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void WorkerThread::postInitialize() |
| 329 { |
| 330 ASSERT(m_workerGlobalScope.get()); |
| 331 m_workerGlobalScope->postInitialize(); |
| 332 } |
| 333 |
| 328 void WorkerThread::cleanup() | 334 void WorkerThread::cleanup() |
| 329 { | 335 { |
| 330 | 336 |
| 331 // This should be called before we start the shutdown procedure. | 337 // This should be called before we start the shutdown procedure. |
| 332 workerReportingProxy().willDestroyWorkerGlobalScope(); | 338 workerReportingProxy().willDestroyWorkerGlobalScope(); |
| 333 | 339 |
| 334 // The below assignment will destroy the context, which will in turn notify
messaging proxy. | 340 // The below assignment will destroy the context, which will in turn notify
messaging proxy. |
| 335 // We cannot let any objects survive past thread exit, because no other thre
ad will run GC or otherwise destroy them. | 341 // We cannot let any objects survive past thread exit, because no other thre
ad will run GC or otherwise destroy them. |
| 336 // If Oilpan is enabled, we detach of the context/global scope, with the fin
al heap cleanup below sweeping it out. | 342 // If Oilpan is enabled, we detach of the context/global scope, with the fin
al heap cleanup below sweeping it out. |
| 337 #if !ENABLE(OILPAN) | 343 #if !ENABLE(OILPAN) |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); | 529 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); |
| 524 } | 530 } |
| 525 | 531 |
| 526 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) | 532 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) |
| 527 { | 533 { |
| 528 MutexLocker locker(m_workerInspectorControllerMutex); | 534 MutexLocker locker(m_workerInspectorControllerMutex); |
| 529 m_workerInspectorController = workerInspectorController; | 535 m_workerInspectorController = workerInspectorController; |
| 530 } | 536 } |
| 531 | 537 |
| 532 } // namespace blink | 538 } // namespace blink |
| OLD | NEW |