OLD | NEW |
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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 inline void DOMWrapperMap<NPObject>::PersistentValueMapTraits::Dispose( | 426 inline void DOMWrapperMap<NPObject>::PersistentValueMapTraits::Dispose( |
427 v8::Isolate* isolate, | 427 v8::Isolate* isolate, |
428 v8::UniquePersistent<v8::Object> value, | 428 v8::UniquePersistent<v8::Object> value, |
429 NPObject* npObject) | 429 NPObject* npObject) |
430 { | 430 { |
431 ASSERT(npObject); | 431 ASSERT(npObject); |
432 if (_NPN_IsAlive(npObject)) | 432 if (_NPN_IsAlive(npObject)) |
433 _NPN_ReleaseObject(npObject); | 433 _NPN_ReleaseObject(npObject); |
434 } | 434 } |
435 | 435 |
436 v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root
, v8::Isolate* isolate) | 436 v8::Local<v8::Object> createV8ObjectForNPObject(v8::Isolate* isolate, NPObject*
object, NPObject* root) |
437 { | 437 { |
438 static v8::Eternal<v8::FunctionTemplate> npObjectDesc; | 438 static v8::Eternal<v8::FunctionTemplate> npObjectDesc; |
439 | 439 |
440 ASSERT(isolate->InContext()); | 440 ASSERT(isolate->InContext()); |
441 | 441 |
442 // If this is a v8 object, just return it. | 442 // If this is a v8 object, just return it. |
443 V8NPObject* v8NPObject = npObjectToV8NPObject(object); | 443 V8NPObject* v8NPObject = npObjectToV8NPObject(object); |
444 if (v8NPObject) | 444 if (v8NPObject) |
445 return v8::Local<v8::Object>::New(isolate, v8NPObject->v8Object); | 445 return v8::Local<v8::Object>::New(isolate, v8NPObject->v8Object); |
446 | 446 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 v8::HandleScope scope(isolate); | 487 v8::HandleScope scope(isolate); |
488 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat
e); | 488 v8::Handle<v8::Object> wrapper = staticNPObjectMap().newLocal(object, isolat
e); |
489 if (!wrapper.IsEmpty()) { | 489 if (!wrapper.IsEmpty()) { |
490 V8DOMWrapper::clearNativeInfo(wrapper, npObjectTypeInfo()); | 490 V8DOMWrapper::clearNativeInfo(wrapper, npObjectTypeInfo()); |
491 staticNPObjectMap().removeAndDispose(object); | 491 staticNPObjectMap().removeAndDispose(object); |
492 _NPN_ReleaseObject(object); | 492 _NPN_ReleaseObject(object); |
493 } | 493 } |
494 } | 494 } |
495 | 495 |
496 } // namespace blink | 496 } // namespace blink |
OLD | NEW |