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

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

Issue 135843008: Remove V8HiddenPropertyName (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "bindings/v8/ExceptionState.h" 61 #include "bindings/v8/ExceptionState.h"
62 #include "bindings/v8/ScriptCallStackFactory.h" 62 #include "bindings/v8/ScriptCallStackFactory.h"
63 #include "bindings/v8/ScriptPromise.h" 63 #include "bindings/v8/ScriptPromise.h"
64 #include "bindings/v8/ScriptState.h" 64 #include "bindings/v8/ScriptState.h"
65 #include "bindings/v8/ScriptValue.h" 65 #include "bindings/v8/ScriptValue.h"
66 #include "bindings/v8/SerializedScriptValue.h" 66 #include "bindings/v8/SerializedScriptValue.h"
67 #include "bindings/v8/V8AbstractEventListener.h" 67 #include "bindings/v8/V8AbstractEventListener.h"
68 #include "bindings/v8/V8DOMActivityLogger.h" 68 #include "bindings/v8/V8DOMActivityLogger.h"
69 #include "bindings/v8/V8DOMConfiguration.h" 69 #include "bindings/v8/V8DOMConfiguration.h"
70 #include "bindings/v8/V8EventListenerList.h" 70 #include "bindings/v8/V8EventListenerList.h"
71 #include "bindings/v8/V8HiddenPropertyName.h"
72 #include "bindings/v8/V8ObjectConstructor.h" 71 #include "bindings/v8/V8ObjectConstructor.h"
73 #include "bindings/v8/custom/V8ArrayBufferCustom.h" 72 #include "bindings/v8/custom/V8ArrayBufferCustom.h"
74 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h" 73 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
75 #include "bindings/v8/custom/V8Float32ArrayCustom.h" 74 #include "bindings/v8/custom/V8Float32ArrayCustom.h"
76 #include "bindings/v8/custom/V8Int32ArrayCustom.h" 75 #include "bindings/v8/custom/V8Int32ArrayCustom.h"
77 #include "bindings/v8/custom/V8Uint8ArrayCustom.h" 76 #include "bindings/v8/custom/V8Uint8ArrayCustom.h"
78 #include "core/css/MediaQueryListListener.h" 77 #include "core/css/MediaQueryListListener.h"
79 #include "core/dom/ContextFeatures.h" 78 #include "core/dom/ContextFeatures.h"
80 #include "core/dom/Document.h" 79 #include "core/dom/Document.h"
81 #include "core/dom/custom/CustomElementCallbackDispatcher.h" 80 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 127 }
129 128
130 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info) 129 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info)
131 { 130 {
132 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 131 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
133 RefPtr<TestInterfaceEmpty> result = imp->readonlyTestInterfaceEmptyAttribute (); 132 RefPtr<TestInterfaceEmpty> result = imp->readonlyTestInterfaceEmptyAttribute ();
134 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEmpty>( info.GetReturnValue(), result.get())) 133 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEmpty>( info.GetReturnValue(), result.get()))
135 return; 134 return;
136 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs olate()); 135 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs olate());
137 if (!wrapper.IsEmpty()) { 136 if (!wrapper.IsEmpty()) {
138 V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readonlyTe stInterfaceEmptyAttribute", wrapper); 137 setHiddenValue(info.GetIsolate(), info.Holder(), "readonlyTestInterfaceE mptyAttribute", wrapper);
139 v8SetReturnValue(info, wrapper); 138 v8SetReturnValue(info, wrapper);
140 } 139 }
141 } 140 }
142 141
143 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 142 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
144 { 143 {
145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 144 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
146 TestObjectPythonV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGett er(info); 145 TestObjectPythonV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGett er(info);
147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 146 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
148 } 147 }
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 } 1609 }
1611 TestObjectPythonV8Internal::activityLoggingSetterForAllWorldsLongAttributeAt tributeSetter(jsValue, info); 1610 TestObjectPythonV8Internal::activityLoggingSetterForAllWorldsLongAttributeAt tributeSetter(jsValue, info);
1612 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1611 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1613 } 1612 }
1614 1613
1615 static void cachedAttributeAnyAttributeAttributeGetter(const v8::PropertyCallbac kInfo<v8::Value>& info) 1614 static void cachedAttributeAnyAttributeAttributeGetter(const v8::PropertyCallbac kInfo<v8::Value>& info)
1616 { 1615 {
1617 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedAttributeAnyAttribute"); 1616 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedAttributeAnyAttribute");
1618 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 1617 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
1619 if (!imp->isValueDirty()) { 1618 if (!imp->isValueDirty()) {
1620 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa me); 1619 v8::Handle<v8::Value> jsValue = getHiddenValue(info.GetIsolate(), info.H older(), propertyName);
1621 if (!jsValue.IsEmpty()) { 1620 if (!jsValue.IsEmpty()) {
1622 v8SetReturnValue(info, jsValue); 1621 v8SetReturnValue(info, jsValue);
1623 return; 1622 return;
1624 } 1623 }
1625 } 1624 }
1626 ScriptValue jsValue = imp->cachedAttributeAnyAttribute(); 1625 ScriptValue jsValue = imp->cachedAttributeAnyAttribute();
1627 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); 1626 setHiddenValue(info.GetIsolate(), info.Holder(), propertyName, jsValue.v8Val ue());
1628 v8SetReturnValue(info, jsValue.v8Value()); 1627 v8SetReturnValue(info, jsValue.v8Value());
1629 } 1628 }
1630 1629
1631 static void cachedAttributeAnyAttributeAttributeGetterCallback(v8::Local<v8::Str ing>, const v8::PropertyCallbackInfo<v8::Value>& info) 1630 static void cachedAttributeAnyAttributeAttributeGetterCallback(v8::Local<v8::Str ing>, const v8::PropertyCallbackInfo<v8::Value>& info)
1632 { 1631 {
1633 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1632 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1634 TestObjectPythonV8Internal::cachedAttributeAnyAttributeAttributeGetter(info) ; 1633 TestObjectPythonV8Internal::cachedAttributeAnyAttributeAttributeGetter(info) ;
1635 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1634 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1636 } 1635 }
1637 1636
1638 static void cachedAttributeAnyAttributeAttributeSetter(v8::Local<v8::Value> jsVa lue, const v8::PropertyCallbackInfo<void>& info) 1637 static void cachedAttributeAnyAttributeAttributeSetter(v8::Local<v8::Value> jsVa lue, const v8::PropertyCallbackInfo<void>& info)
1639 { 1638 {
1640 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 1639 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
1641 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate( ))); 1640 V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate( )));
1642 imp->setCachedAttributeAnyAttribute(cppValue); 1641 imp->setCachedAttributeAnyAttribute(cppValue);
1643 info.Holder()->DeleteHiddenValue(v8AtomicString(info.GetIsolate(), "cachedAt tributeAnyAttribute")); // Invalidate the cached value. 1642 deleteHiddenValue(info.GetIsolate(), info.Holder(), "cachedAttributeAnyAttri bute"); // Invalidate the cached value.
1644 } 1643 }
1645 1644
1646 static void cachedAttributeAnyAttributeAttributeSetterCallback(v8::Local<v8::Str ing>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 1645 static void cachedAttributeAnyAttributeAttributeSetterCallback(v8::Local<v8::Str ing>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1647 { 1646 {
1648 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1647 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1649 TestObjectPythonV8Internal::cachedAttributeAnyAttributeAttributeSetter(jsVal ue, info); 1648 TestObjectPythonV8Internal::cachedAttributeAnyAttributeAttributeSetter(jsVal ue, info);
1650 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1649 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1651 } 1650 }
1652 1651
1653 static void callWithExecutionContextAnyAttributeAttributeGetter(const v8::Proper tyCallbackInfo<v8::Value>& info) 1652 static void callWithExecutionContextAnyAttributeAttributeGetter(const v8::Proper tyCallbackInfo<v8::Value>& info)
(...skipping 5441 matching lines...) Expand 10 before | Expand all | Expand 10 after
7095 fromInternalPointer(object)->deref(); 7094 fromInternalPointer(object)->deref();
7096 } 7095 }
7097 7096
7098 template<> 7097 template<>
7099 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) 7098 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate)
7100 { 7099 {
7101 return toV8(impl, creationContext, isolate); 7100 return toV8(impl, creationContext, isolate);
7102 } 7101 }
7103 7102
7104 } // namespace WebCore 7103 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/bindings/v8/CustomElementConstructorBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698