Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: Source/bindings/core/v8/WorkerScriptController.cpp

Issue 429453010: Drop V8RecursionScope dependency on ExecutionContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reorder cleanup methods per haraken Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 if (isContextInitialized()) 153 if (isContextInitialized())
154 m_scriptState->disposePerContextData(); 154 m_scriptState->disposePerContextData();
155 155
156 V8PerIsolateData::willBeDestroyed(m_isolate);
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
163 if (isContextInitialized()) 165 if (isContextInitialized())
164 return true; 166 return true;
165 167
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8ScriptRunner.cpp ('k') | Source/bindings/modules/v8/ModuleBindingsInitializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698