Chromium Code Reviews| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 // are destroyed. | 123 // are destroyed. |
| 124 class IsolateCleanupTask : public ThreadState::CleanupTask { | 124 class IsolateCleanupTask : public ThreadState::CleanupTask { |
| 125 public: | 125 public: |
| 126 static PassOwnPtr<IsolateCleanupTask> create(v8::Isolate* isolate) | 126 static PassOwnPtr<IsolateCleanupTask> create(v8::Isolate* isolate) |
| 127 { | 127 { |
| 128 return adoptPtr(new IsolateCleanupTask(isolate)); | 128 return adoptPtr(new IsolateCleanupTask(isolate)); |
| 129 } | 129 } |
| 130 | 130 |
| 131 virtual void postCleanup() | 131 virtual void postCleanup() |
| 132 { | 132 { |
| 133 V8PerIsolateData::dispose(m_isolate); | 133 V8PerIsolateData::destroy(m_isolate); |
| 134 } | 134 } |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 explicit IsolateCleanupTask(v8::Isolate* isolate) : m_isolate(isolate) { } | 137 explicit IsolateCleanupTask(v8::Isolate* isolate) : m_isolate(isolate) { } |
| 138 | 138 |
| 139 v8::Isolate* m_isolate; | 139 v8::Isolate* m_isolate; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 WorkerScriptController::~WorkerScriptController() | 142 WorkerScriptController::~WorkerScriptController() |
| 143 { | 143 { |
| 144 ThreadState::current()->removeInterruptor(m_interruptor.get()); | 144 ThreadState::current()->removeInterruptor(m_interruptor.get()); |
| 145 | 145 |
| 146 m_world->dispose(); | 146 m_world->dispose(); |
| 147 | 147 |
| 148 // The corresponding call to didStartWorkerRunLoop is in | 148 // The corresponding call to didStartWorkerRunLoop is in |
| 149 // WorkerThread::initialize(). | 149 // WorkerThread::initialize(). |
| 150 // See http://webkit.org/b/83104#c14 for why this is here. | 150 // See http://webkit.org/b/83104#c14 for why this is here. |
| 151 blink::Platform::current()->didStopWorkerRunLoop(blink::WebWorkerRunLoop(m_w orkerGlobalScope.thread())); | 151 blink::Platform::current()->didStopWorkerRunLoop(blink::WebWorkerRunLoop(m_w orkerGlobalScope.thread())); |
| 152 | 152 |
| 153 V8PerIsolateData::willBeDestroyed(m_isolate); | |
|
haraken
2014/09/11 23:21:18
Nit: I'd put this after line 156. Conceptually Per
jsbell
2014/09/12 23:27:48
Done.
| |
| 154 | |
| 153 if (isContextInitialized()) | 155 if (isContextInitialized()) |
| 154 m_scriptState->disposePerContextData(); | 156 m_scriptState->disposePerContextData(); |
| 155 | 157 |
| 156 ThreadState::current()->addCleanupTask(IsolateCleanupTask::create(m_isolate) ); | 158 ThreadState::current()->addCleanupTask(IsolateCleanupTask::create(m_isolate) ); |
| 157 } | 159 } |
| 158 | 160 |
| 159 bool WorkerScriptController::initializeContextIfNeeded() | 161 bool WorkerScriptController::initializeContextIfNeeded() |
| 160 { | 162 { |
| 161 v8::HandleScope handleScope(m_isolate); | 163 v8::HandleScope handleScope(m_isolate); |
| 162 | 164 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 | 311 |
| 310 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) | 312 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtrWillBe RawPtr<ErrorEvent> errorEvent, ExceptionState& exceptionState) |
| 311 { | 313 { |
| 312 const String& errorMessage = errorEvent->message(); | 314 const String& errorMessage = errorEvent->message(); |
| 313 if (m_globalScopeExecutionState) | 315 if (m_globalScopeExecutionState) |
| 314 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent ; | 316 m_globalScopeExecutionState->m_errorEventFromImportedScript = errorEvent ; |
| 315 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(error Message, m_isolate)); | 317 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(error Message, m_isolate)); |
| 316 } | 318 } |
| 317 | 319 |
| 318 } // namespace blink | 320 } // namespace blink |
| OLD | NEW |