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

Side by Side Diff: Source/bindings/tests/results/V8TestInterface2.cpp

Issue 456683002: bindings: Introduces type-check for the internal pointers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 4 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterface2.h" 8 #include "V8TestInterface2.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 420 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
421 { 421 {
422 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty"); 422 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMNamedProperty");
423 TestInterface2V8Internal::namedPropertyEnumerator(info); 423 TestInterface2V8Internal::namedPropertyEnumerator(info);
424 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 424 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
425 } 425 }
426 426
427 } // namespace TestInterface2V8Internal 427 } // namespace TestInterface2V8Internal
428 428
429 void V8TestInterface2::visitDOMWrapper(void* object, const v8::Persistent<v8::Ob ject>& wrapper, v8::Isolate* isolate) 429 void V8TestInterface2::visitDOMWrapper(ScriptWrappableBase* internalPointer, con st v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
430 { 430 {
431 TestInterface2* impl = fromInternalPointer(object); 431 TestInterface2* impl = fromInternalPointer(internalPointer);
432 // The ownerNode() method may return a reference or a pointer. 432 // The ownerNode() method may return a reference or a pointer.
433 if (Node* owner = WTF::getPtr(impl->ownerNode())) { 433 if (Node* owner = WTF::getPtr(impl->ownerNode())) {
434 Node* root = V8GCController::opaqueRootForGC(owner, isolate); 434 Node* root = V8GCController::opaqueRootForGC(owner, isolate);
435 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(r oot)), wrapper); 435 isolate->SetReferenceFromGroup(v8::UniqueId(reinterpret_cast<intptr_t>(r oot)), wrapper);
436 return; 436 return;
437 } 437 }
438 setObjectGroup(object, wrapper, isolate); 438 setObjectGroup(internalPointer, wrapper, isolate);
439 } 439 }
440 440
441 static const V8DOMConfiguration::MethodConfiguration V8TestInterface2Methods[] = { 441 static const V8DOMConfiguration::MethodConfiguration V8TestInterface2Methods[] = {
442 {"item", TestInterface2V8Internal::itemMethodCallback, 0, 1, V8DOMConfigurat ion::ExposedToAllScripts}, 442 {"item", TestInterface2V8Internal::itemMethodCallback, 0, 1, V8DOMConfigurat ion::ExposedToAllScripts},
443 {"setItem", TestInterface2V8Internal::setItemMethodCallback, 0, 2, V8DOMConf iguration::ExposedToAllScripts}, 443 {"setItem", TestInterface2V8Internal::setItemMethodCallback, 0, 2, V8DOMConf iguration::ExposedToAllScripts},
444 {"deleteItem", TestInterface2V8Internal::deleteItemMethodCallback, 0, 1, V8D OMConfiguration::ExposedToAllScripts}, 444 {"deleteItem", TestInterface2V8Internal::deleteItemMethodCallback, 0, 1, V8D OMConfiguration::ExposedToAllScripts},
445 {"namedItem", TestInterface2V8Internal::namedItemMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts}, 445 {"namedItem", TestInterface2V8Internal::namedItemMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts},
446 {"setNamedItem", TestInterface2V8Internal::setNamedItemMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, 446 {"setNamedItem", TestInterface2V8Internal::setNamedItemMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts},
447 {"deleteNamedItem", TestInterface2V8Internal::deleteNamedItemMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 447 {"deleteNamedItem", TestInterface2V8Internal::deleteNamedItemMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
448 {"stringifierMethod", TestInterface2V8Internal::stringifierMethodMethodCallb ack, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 448 {"stringifierMethod", TestInterface2V8Internal::stringifierMethodMethodCallb ack, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e); 496 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu e);
497 } 497 }
498 498
499 v8::Handle<v8::Object> V8TestInterface2::findInstanceInPrototypeChain(v8::Handle <v8::Value> v8Value, v8::Isolate* isolate) 499 v8::Handle<v8::Object> V8TestInterface2::findInstanceInPrototypeChain(v8::Handle <v8::Value> v8Value, v8::Isolate* isolate)
500 { 500 {
501 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value); 501 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe rTypeInfo, v8Value);
502 } 502 }
503 503
504 TestInterface2* V8TestInterface2::toNativeWithTypeCheck(v8::Isolate* isolate, v8 ::Handle<v8::Value> value) 504 TestInterface2* V8TestInterface2::toNativeWithTypeCheck(v8::Isolate* isolate, v8 ::Handle<v8::Value> value)
505 { 505 {
506 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; 506 return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPo inter(v8::Handle<v8::Object>::Cast(value))) : 0;
507 } 507 }
508 508
509 v8::Handle<v8::Object> wrap(TestInterface2* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 509 v8::Handle<v8::Object> wrap(TestInterface2* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate)
510 { 510 {
511 ASSERT(impl); 511 ASSERT(impl);
512 if (impl->isTestInterface()) 512 if (impl->isTestInterface())
513 return wrap(toTestInterface(impl), creationContext, isolate); 513 return wrap(toTestInterface(impl), creationContext, isolate);
514 if (impl->isTestInterfaceEmpty()) 514 if (impl->isTestInterfaceEmpty())
515 return wrap(toTestInterfaceEmpty(impl), creationContext, isolate); 515 return wrap(toTestInterfaceEmpty(impl), creationContext, isolate);
516 v8::Handle<v8::Object> wrapper = V8TestInterface2::createWrapper(impl, creat ionContext, isolate); 516 v8::Handle<v8::Object> wrapper = V8TestInterface2::createWrapper(impl, creat ionContext, isolate);
(...skipping 13 matching lines...) Expand all
530 530
531 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); 531 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
532 if (UNLIKELY(wrapper.IsEmpty())) 532 if (UNLIKELY(wrapper.IsEmpty()))
533 return wrapper; 533 return wrapper;
534 534
535 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 535 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
536 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface2>(impl, &wrapperTyp eInfo, wrapper, isolate, WrapperConfiguration::Dependent); 536 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface2>(impl, &wrapperTyp eInfo, wrapper, isolate, WrapperConfiguration::Dependent);
537 return wrapper; 537 return wrapper;
538 } 538 }
539 539
540 void V8TestInterface2::derefObject(void* object) 540 void V8TestInterface2::derefObject(ScriptWrappableBase* internalPointer)
541 { 541 {
542 fromInternalPointer(object)->deref(); 542 fromInternalPointer(internalPointer)->deref();
543 } 543 }
544 544
545 template<> 545 template<>
546 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 546 v8::Handle<v8::Value> toV8NoInline(TestInterface2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
547 { 547 {
548 return toV8(impl, creationContext, isolate); 548 return toV8(impl, creationContext, isolate);
549 } 549 }
550 550
551 } // namespace blink 551 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface2.h ('k') | Source/bindings/tests/results/V8TestInterface3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698