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

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

Issue 23788005: Remove calls to HandleScope default ctor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review (pfeldman) 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
« no previous file with comments | « Source/bindings/v8/DOMRequestState.h ('k') | Source/bindings/v8/ScriptCallStackFactory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2007, 2008, 2009 Google, Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2009 Google, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri ng* npScript, NPVariant* result) 329 bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri ng* npScript, NPVariant* result)
330 { 330 {
331 VOID_TO_NPVARIANT(*result); 331 VOID_TO_NPVARIANT(*result);
332 if (!npObject) 332 if (!npObject)
333 return false; 333 return false;
334 334
335 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject); 335 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject);
336 if (!v8NpObject) 336 if (!v8NpObject)
337 return false; 337 return false;
338 338
339 v8::HandleScope handleScope; 339 v8::HandleScope handleScope(v8::Isolate::GetCurrent());
340 v8::Handle<v8::Context> context = toV8Context(npp, npObject); 340 v8::Handle<v8::Context> context = toV8Context(npp, npObject);
341 if (context.IsEmpty()) 341 if (context.IsEmpty())
342 return false; 342 return false;
343 343
344 v8::Context::Scope scope(context); 344 v8::Context::Scope scope(context);
345 ExceptionCatcher exceptionCatcher; 345 ExceptionCatcher exceptionCatcher;
346 346
347 // FIXME: Is this branch still needed after switching to using UserGestureIn dicator? 347 // FIXME: Is this branch still needed after switching to using UserGestureIn dicator?
348 String filename; 348 String filename;
349 if (!popupsAllowed) 349 if (!popupsAllowed)
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) 498 void _NPN_SetException(NPObject* npObject, const NPUTF8 *message)
499 { 499 {
500 if (!npObject || !npObjectToV8NPObject(npObject)) { 500 if (!npObject || !npObjectToV8NPObject(npObject)) {
501 // We won't be able to find a proper scope for this exception, so just t hrow it. 501 // We won't be able to find a proper scope for this exception, so just t hrow it.
502 // This is consistent with JSC, which throws a global exception all the time. 502 // This is consistent with JSC, which throws a global exception all the time.
503 throwError(v8GeneralError, message, v8::Isolate::GetCurrent()); 503 throwError(v8GeneralError, message, v8::Isolate::GetCurrent());
504 return; 504 return;
505 } 505 }
506 506
507 v8::HandleScope handleScope; 507 v8::HandleScope handleScope(v8::Isolate::GetCurrent());
508 v8::Handle<v8::Context> context = toV8Context(0, npObject); 508 v8::Handle<v8::Context> context = toV8Context(0, npObject);
509 if (context.IsEmpty()) 509 if (context.IsEmpty())
510 return; 510 return;
511 511
512 v8::Context::Scope scope(context); 512 v8::Context::Scope scope(context);
513 ExceptionCatcher exceptionCatcher; 513 ExceptionCatcher exceptionCatcher;
514 514
515 throwError(v8GeneralError, message, context->GetIsolate()); 515 throwError(v8GeneralError, message, context->GetIsolate());
516 } 516 }
517 517
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 605
606 convertV8ObjectToNPVariant(resultObject, npObject, result); 606 convertV8ObjectToNPVariant(resultObject, npObject, result);
607 return true; 607 return true;
608 } 608 }
609 609
610 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct) 610 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct)
611 return npObject->_class->construct(npObject, arguments, argumentCount, r esult); 611 return npObject->_class->construct(npObject, arguments, argumentCount, r esult);
612 612
613 return false; 613 return false;
614 } 614 }
OLDNEW
« no previous file with comments | « Source/bindings/v8/DOMRequestState.h ('k') | Source/bindings/v8/ScriptCallStackFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698