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

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

Issue 170603003: Use nullptr_t for RefPtr, PassRefPtr and RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final rebase Created 6 years, 10 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 OwnPtr<gin::IsolateHolder> m_isolateHolder; 99 OwnPtr<gin::IsolateHolder> m_isolateHolder;
100 }; 100 };
101 101
102 WorkerScriptController::~WorkerScriptController() 102 WorkerScriptController::~WorkerScriptController()
103 { 103 {
104 ThreadState::current()->removeInterruptor(m_interruptor.get()); 104 ThreadState::current()->removeInterruptor(m_interruptor.get());
105 105
106 RELEASE_ASSERT(m_world->hasOneRef()); 106 RELEASE_ASSERT(m_world->hasOneRef());
107 // ~DOMWrapperWorld() must be called before disposing the isolate. 107 // ~DOMWrapperWorld() must be called before disposing the isolate.
108 m_world = 0; 108 m_world = nullptr;
109 109
110 // The corresponding call to didStartWorkerRunLoop is in 110 // The corresponding call to didStartWorkerRunLoop is in
111 // WorkerThread::workerThread(). 111 // WorkerThread::workerThread().
112 // See http://webkit.org/b/83104#c14 for why this is here. 112 // See http://webkit.org/b/83104#c14 for why this is here.
113 blink::Platform::current()->didStopWorkerRunLoop(blink::WebWorkerRunLoop(&m_ workerGlobalScope.thread()->runLoop())); 113 blink::Platform::current()->didStopWorkerRunLoop(blink::WebWorkerRunLoop(&m_ workerGlobalScope.thread()->runLoop()));
114 114
115 disposeContext(); 115 disposeContext();
116 116
117 ThreadState::current()->addCleanupTask(IsolateCleanupTask::create(m_isolateH older.release())); 117 ThreadState::current()->addCleanupTask(IsolateCleanupTask::create(m_isolateH older.release()));
118 } 118 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, RefPtr <ErrorEvent>* errorEvent) 219 void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, RefPtr <ErrorEvent>* errorEvent)
220 { 220 {
221 if (isExecutionForbidden()) 221 if (isExecutionForbidden())
222 return; 222 return;
223 223
224 WorkerGlobalScopeExecutionState state; 224 WorkerGlobalScopeExecutionState state;
225 evaluate(sourceCode.source(), sourceCode.url().string(), sourceCode.startPos ition(), &state); 225 evaluate(sourceCode.source(), sourceCode.url().string(), sourceCode.startPos ition(), &state);
226 if (state.hadException) { 226 if (state.hadException) {
227 if (errorEvent) { 227 if (errorEvent) {
228 *errorEvent = m_workerGlobalScope.shouldSanitizeScriptError(state.so urceURL, NotSharableCrossOrigin) ? 228 *errorEvent = m_workerGlobalScope.shouldSanitizeScriptError(state.so urceURL, NotSharableCrossOrigin) ?
229 ErrorEvent::createSanitizedError(0) : ErrorEvent::create(state.e rrorMessage, state.sourceURL, state.lineNumber, state.columnNumber, 0); 229 ErrorEvent::createSanitizedError(nullptr) : ErrorEvent::create(s tate.errorMessage, state.sourceURL, state.lineNumber, state.columnNumber, nullpt r);
230 V8ErrorHandler::storeExceptionOnErrorEventWrapper(errorEvent->get(), state.exception.v8Value(), isolate()); 230 V8ErrorHandler::storeExceptionOnErrorEventWrapper(errorEvent->get(), state.exception.v8Value(), isolate());
231 } else { 231 } else {
232 ASSERT(!m_workerGlobalScope.shouldSanitizeScriptError(state.sourceUR L, NotSharableCrossOrigin)); 232 ASSERT(!m_workerGlobalScope.shouldSanitizeScriptError(state.sourceUR L, NotSharableCrossOrigin));
233 RefPtr<ErrorEvent> event = m_errorEventFromImportedScript ? m_errorE ventFromImportedScript.release() : ErrorEvent::create(state.errorMessage, state. sourceURL, state.lineNumber, state.columnNumber, 0); 233 RefPtr<ErrorEvent> event = m_errorEventFromImportedScript ? m_errorE ventFromImportedScript.release() : ErrorEvent::create(state.errorMessage, state. sourceURL, state.lineNumber, state.columnNumber, nullptr);
234 m_workerGlobalScope.reportException(event, 0, NotSharableCrossOrigin ); 234 m_workerGlobalScope.reportException(event, nullptr, NotSharableCross Origin);
235 } 235 }
236 } 236 }
237 } 237 }
238 238
239 void WorkerScriptController::scheduleExecutionTermination() 239 void WorkerScriptController::scheduleExecutionTermination()
240 { 240 {
241 // The mutex provides a memory barrier to ensure that once 241 // The mutex provides a memory barrier to ensure that once
242 // termination is scheduled, isExecutionTerminating will 242 // termination is scheduled, isExecutionTerminating will
243 // accurately reflect that state when called from another thread. 243 // accurately reflect that state when called from another thread.
244 { 244 {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 v8::Handle<v8::Object> global = context->Global(); 287 v8::Handle<v8::Object> global = context->Global();
288 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::domTempla te(isolate, WorkerWorld)); 288 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::domTempla te(isolate, WorkerWorld));
289 // Return 0 if the current executing context is not the worker context. 289 // Return 0 if the current executing context is not the worker context.
290 if (global.IsEmpty()) 290 if (global.IsEmpty())
291 return 0; 291 return 0;
292 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ; 292 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ;
293 return workerGlobalScope->script(); 293 return workerGlobalScope->script();
294 } 294 }
295 295
296 } // namespace WebCore 296 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8ValueCache.cpp ('k') | Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698