OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 WorkerScriptController::WorkerScriptController(WorkerGlobalScope& workerGlobalSc
ope) | 106 WorkerScriptController::WorkerScriptController(WorkerGlobalScope& workerGlobalSc
ope) |
107 : m_isolate(0) | 107 : m_isolate(0) |
108 , m_workerGlobalScope(workerGlobalScope) | 108 , m_workerGlobalScope(workerGlobalScope) |
109 , m_executionForbidden(false) | 109 , m_executionForbidden(false) |
110 , m_executionScheduledToTerminate(false) | 110 , m_executionScheduledToTerminate(false) |
111 , m_globalScopeExecutionState(0) | 111 , m_globalScopeExecutionState(0) |
112 { | 112 { |
113 m_isolate = V8PerIsolateData::initialize(); | 113 m_isolate = V8PerIsolateData::initialize(); |
114 V8Initializer::initializeWorker(m_isolate); | 114 V8Initializer::initializeWorker(m_isolate); |
115 m_world = DOMWrapperWorld::create(WorkerWorldId); | 115 m_world = DOMWrapperWorld::create(m_isolate, WorkerWorldId); |
116 m_interruptor = adoptPtr(new V8IsolateInterruptor(m_isolate)); | 116 m_interruptor = adoptPtr(new V8IsolateInterruptor(m_isolate)); |
117 ThreadState::current()->addInterruptor(m_interruptor.get()); | 117 ThreadState::current()->addInterruptor(m_interruptor.get()); |
118 ThreadState::current()->registerTraceDOMWrappers(m_isolate, V8GCController::
traceDOMWrappers); | 118 ThreadState::current()->registerTraceDOMWrappers(m_isolate, V8GCController::
traceDOMWrappers); |
119 } | 119 } |
120 | 120 |
121 // We need to postpone V8 Isolate destruction until the very end of | 121 // We need to postpone V8 Isolate destruction until the very end of |
122 // worker thread finalization when all objects on the worker heap | 122 // worker thread finalization when all objects on the worker heap |
123 // are destroyed. | 123 // are destroyed. |
124 class IsolateCleanupTask : public ThreadState::CleanupTask { | 124 class IsolateCleanupTask : public ThreadState::CleanupTask { |
125 public: | 125 public: |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) | 310 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) |
311 { | 311 { |
312 const String& errorMessage = errorEvent->message(); | 312 const String& errorMessage = errorEvent->message(); |
313 if (m_globalScopeExecutionState) | 313 if (m_globalScopeExecutionState) |
314 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent
; | 314 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent
; |
315 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); | 315 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); |
316 } | 316 } |
317 | 317 |
318 } // namespace blink | 318 } // namespace blink |
OLD | NEW |