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

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

Issue 23993004: Have convertNPVariantToV8Object() use the isolate it is given (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/V8NPObject.h ('k') | Source/bindings/v8/V8NPUtils.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) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 ASSERT(staticNPObjectMap().containsKeyAndValue(npObject, *wrapper)); 408 ASSERT(staticNPObjectMap().containsKeyAndValue(npObject, *wrapper));
409 409
410 // Must remove from our map before calling _NPN_ReleaseObject(). _NPN_Releas eObject can 410 // Must remove from our map before calling _NPN_ReleaseObject(). _NPN_Releas eObject can
411 // call forgetV8ObjectForNPObject, which uses the table as well. 411 // call forgetV8ObjectForNPObject, which uses the table as well.
412 staticNPObjectMap().removeAndDispose(npObject); 412 staticNPObjectMap().removeAndDispose(npObject);
413 413
414 if (_NPN_IsAlive(npObject)) 414 if (_NPN_IsAlive(npObject))
415 _NPN_ReleaseObject(npObject); 415 _NPN_ReleaseObject(npObject);
416 } 416 }
417 417
418 v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root ) 418 v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root , v8::Isolate* isolate)
419 { 419 {
420 static v8::Eternal<v8::FunctionTemplate> npObjectDesc; 420 static v8::Eternal<v8::FunctionTemplate> npObjectDesc;
421 421
422 ASSERT(v8::Context::InContext()); 422 ASSERT(v8::Context::InContext());
423 423
424 v8::Isolate* isolate = v8::Isolate::GetCurrent();
425
426 // If this is a v8 object, just return it. 424 // If this is a v8 object, just return it.
427 V8NPObject* v8NPObject = npObjectToV8NPObject(object); 425 V8NPObject* v8NPObject = npObjectToV8NPObject(object);
428 if (v8NPObject) 426 if (v8NPObject)
429 return v8::Local<v8::Object>::New(isolate, v8NPObject->v8Object); 427 return v8::Local<v8::Object>::New(isolate, v8NPObject->v8Object);
430 428
431 // If we've already wrapped this object, just return it. 429 // If we've already wrapped this object, just return it.
432 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat e); 430 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat e);
433 if (!wrapper.IsEmpty()) 431 if (!wrapper.IsEmpty())
434 return wrapper; 432 return wrapper;
435 433
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 v8::HandleScope scope(isolate); 470 v8::HandleScope scope(isolate);
473 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat e); 471 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat e);
474 if (!wrapper.IsEmpty()) { 472 if (!wrapper.IsEmpty()) {
475 V8DOMWrapper::clearNativeInfo(wrapper, npObjectTypeInfo()); 473 V8DOMWrapper::clearNativeInfo(wrapper, npObjectTypeInfo());
476 staticNPObjectMap().removeAndDispose(object); 474 staticNPObjectMap().removeAndDispose(object);
477 _NPN_ReleaseObject(object); 475 _NPN_ReleaseObject(object);
478 } 476 }
479 } 477 }
480 478
481 } // namespace WebCore 479 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8NPObject.h ('k') | Source/bindings/v8/V8NPUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698