| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 , m_workerGlobalScope(workerGlobalScope) | 109 , m_workerGlobalScope(workerGlobalScope) |
| 110 , m_executionForbidden(false) | 110 , m_executionForbidden(false) |
| 111 , m_executionScheduledToTerminate(false) | 111 , m_executionScheduledToTerminate(false) |
| 112 , m_globalScopeExecutionState(0) | 112 , m_globalScopeExecutionState(0) |
| 113 { | 113 { |
| 114 m_isolate = V8PerIsolateData::initialize(); | 114 m_isolate = V8PerIsolateData::initialize(); |
| 115 V8Initializer::initializeWorker(m_isolate); | 115 V8Initializer::initializeWorker(m_isolate); |
| 116 m_world = DOMWrapperWorld::create(WorkerWorldId); | 116 m_world = DOMWrapperWorld::create(WorkerWorldId); |
| 117 m_interruptor = adoptPtr(new V8IsolateInterruptor(m_isolate)); | 117 m_interruptor = adoptPtr(new V8IsolateInterruptor(m_isolate)); |
| 118 ThreadState::current()->addInterruptor(m_interruptor.get()); | 118 ThreadState::current()->addInterruptor(m_interruptor.get()); |
| 119 ThreadState::current()->registerTraceDOMWrappers(m_isolate, V8GCController::
traceDOMWrappers); |
| 119 } | 120 } |
| 120 | 121 |
| 121 // We need to postpone V8 Isolate destruction until the very end of | 122 // We need to postpone V8 Isolate destruction until the very end of |
| 122 // worker thread finalization when all objects on the worker heap | 123 // worker thread finalization when all objects on the worker heap |
| 123 // are destroyed. | 124 // are destroyed. |
| 124 class IsolateCleanupTask : public ThreadState::CleanupTask { | 125 class IsolateCleanupTask : public ThreadState::CleanupTask { |
| 125 public: | 126 public: |
| 126 static PassOwnPtr<IsolateCleanupTask> create(v8::Isolate* isolate) | 127 static PassOwnPtr<IsolateCleanupTask> create(v8::Isolate* isolate) |
| 127 { | 128 { |
| 128 return adoptPtr(new IsolateCleanupTask(isolate)); | 129 return adoptPtr(new IsolateCleanupTask(isolate)); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 308 |
| 308 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) | 309 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe
RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) |
| 309 { | 310 { |
| 310 const String& errorMessage = errorEvent->message(); | 311 const String& errorMessage = errorEvent->message(); |
| 311 if (m_globalScopeExecutionState) | 312 if (m_globalScopeExecutionState) |
| 312 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent
; | 313 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent
; |
| 313 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(error
Message, m_isolate)); | 314 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(error
Message, m_isolate)); |
| 314 } | 315 } |
| 315 | 316 |
| 316 } // namespace blink | 317 } // namespace blink |
| OLD | NEW |