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

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

Issue 24118003: Pass isolate to v8::Undefined() function (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 232
233 void WorkerScriptController::disableEval(const String& errorMessage) 233 void WorkerScriptController::disableEval(const String& errorMessage)
234 { 234 {
235 m_disableEvalPending = errorMessage; 235 m_disableEvalPending = errorMessage;
236 } 236 }
237 237
238 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtr<Error Event> errorEvent) 238 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtr<Error Event> errorEvent)
239 { 239 {
240 m_errorEventFromImportedScript = errorEvent; 240 m_errorEventFromImportedScript = errorEvent;
241 throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImp ortedScript->message(), m_isolate)); 241 throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImp ortedScript->message(), m_isolate), m_isolate);
242 } 242 }
243 243
244 WorkerScriptController* WorkerScriptController::controllerForContext() 244 WorkerScriptController* WorkerScriptController::controllerForContext()
245 { 245 {
246 // Happens on frame destruction, check otherwise GetCurrent() will crash. 246 // Happens on frame destruction, check otherwise GetCurrent() will crash.
247 if (!v8::Context::InContext()) 247 if (!v8::Context::InContext())
248 return 0; 248 return 0;
249 v8::Handle<v8::Context> context = v8::Context::GetCurrent(); 249 v8::Handle<v8::Context> context = v8::Context::GetCurrent();
250 v8::Handle<v8::Object> global = context->Global(); 250 v8::Handle<v8::Object> global = context->Global();
251 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTempla te(context->GetIsolate(), WorkerWorld)); 251 global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTempla te(context->GetIsolate(), WorkerWorld));
252 // Return 0 if the current executing context is not the worker context. 252 // Return 0 if the current executing context is not the worker context.
253 if (global.IsEmpty()) 253 if (global.IsEmpty())
254 return 0; 254 return 0;
255 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ; 255 WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(global) ;
256 return workerGlobalScope->script(); 256 return workerGlobalScope->script();
257 } 257 }
258 258
259 } // namespace WebCore 259 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8ThrowException.cpp ('k') | Source/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698