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

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

Issue 684083002: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8NPObject.cpp » ('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 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 if (npObject->_class->hasMethod) 504 if (npObject->_class->hasMethod)
505 return npObject->_class->hasMethod(npObject, methodName); 505 return npObject->_class->hasMethod(npObject, methodName);
506 return false; 506 return false;
507 } 507 }
508 508
509 void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) 509 void _NPN_SetException(NPObject* npObject, const NPUTF8 *message)
510 { 510 {
511 if (!npObject || !npObjectToV8NPObject(npObject)) { 511 if (!npObject || !npObjectToV8NPObject(npObject)) {
512 // We won't be able to find a proper scope for this exception, so just t hrow it. 512 // We won't be able to find a proper scope for this exception, so just t hrow it.
513 // This is consistent with JSC, which throws a global exception all the time. 513 // This is consistent with JSC, which throws a global exception all the time.
514 V8ThrowException::throwGeneralError(message, v8::Isolate::GetCurrent()); 514 V8ThrowException::throwGeneralError(v8::Isolate::GetCurrent(), message);
515 return; 515 return;
516 } 516 }
517 517
518 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 518 v8::Isolate* isolate = v8::Isolate::GetCurrent();
519 ScriptState* scriptState = mainWorldScriptState(isolate, 0, npObject); 519 ScriptState* scriptState = mainWorldScriptState(isolate, 0, npObject);
520 if (!scriptState) 520 if (!scriptState)
521 return; 521 return;
522 522
523 ScriptState::Scope scope(scriptState); 523 ScriptState::Scope scope(scriptState);
524 ExceptionCatcher exceptionCatcher; 524 ExceptionCatcher exceptionCatcher;
525 525
526 V8ThrowException::throwGeneralError(message, isolate); 526 V8ThrowException::throwGeneralError(isolate, message);
527 } 527 }
528 528
529 bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint 32_t* count) 529 bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint 32_t* count)
530 { 530 {
531 if (!npObject) 531 if (!npObject)
532 return false; 532 return false;
533 533
534 if (V8NPObject* object = npObjectToV8NPObject(npObject)) { 534 if (V8NPObject* object = npObjectToV8NPObject(npObject)) {
535 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 535 v8::Isolate* isolate = v8::Isolate::GetCurrent();
536 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject); 536 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 614
615 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate); 615 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate);
616 return true; 616 return true;
617 } 617 }
618 618
619 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct) 619 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct)
620 return npObject->_class->construct(npObject, arguments, argumentCount, r esult); 620 return npObject->_class->construct(npObject, arguments, argumentCount, r esult);
621 621
622 return false; 622 return false;
623 } 623 }
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8NPObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698