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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp

Issue 2653883006: [bindings] Move callback functions from V8FooInternal namespace to V8Foo class (Closed)
Patch Set: Revert expose change Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
index 61a67c10e18700d9736198eb462e7d03ec029433..3faab6748e01e38f6def11f707e7305b616bbe9e 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp
@@ -77,10 +77,6 @@ static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8SetReturnValue(info, result);
}
-CORE_EXPORT void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
- TestSpecialOperationsV8Internal::namedItemMethod(info);
-}
-
static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Value>& info) {
TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());
NodeOrNodeList result;
@@ -90,14 +86,6 @@ static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
v8SetReturnValue(info, result);
}
-CORE_EXPORT void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
- if (!name->IsString())
- return;
- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
-
- TestSpecialOperationsV8Internal::namedPropertyGetter(propertyName, info);
-}
-
static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());
Node* propertyValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value);
@@ -112,14 +100,6 @@ static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
v8SetReturnValue(info, v8Value);
}
-CORE_EXPORT void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
- if (!name->IsString())
- return;
- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
-
- TestSpecialOperationsV8Internal::namedPropertySetter(propertyName, v8Value, info);
-}
-
static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Integer>& info) {
const CString& nameInUtf8 = name.utf8();
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "TestSpecialOperations", nameInUtf8.data());
@@ -132,14 +112,6 @@ static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
v8SetReturnValueInt(info, v8::None);
}
-CORE_EXPORT void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) {
- if (!name->IsString())
- return;
- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
-
- TestSpecialOperationsV8Internal::namedPropertyQuery(propertyName, info);
-}
-
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) {
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationContext, "TestSpecialOperations");
@@ -152,26 +124,54 @@ static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
v8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>());
}
-CORE_EXPORT void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info) {
+} // namespace TestSpecialOperationsV8Internal
+
+void V8TestSpecialOperations::namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ TestSpecialOperationsV8Internal::namedItemMethod(info);
+}
+
+void V8TestSpecialOperations::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
+ if (!name->IsString())
+ return;
+ const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+
+ TestSpecialOperationsV8Internal::namedPropertyGetter(propertyName, info);
+}
+
+void V8TestSpecialOperations::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
+ if (!name->IsString())
+ return;
+ const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+
+ TestSpecialOperationsV8Internal::namedPropertySetter(propertyName, v8Value, info);
+}
+
+void V8TestSpecialOperations::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) {
+ if (!name->IsString())
+ return;
+ const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+
+ TestSpecialOperationsV8Internal::namedPropertyQuery(propertyName, info);
+}
+
+void V8TestSpecialOperations::namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info) {
TestSpecialOperationsV8Internal::namedPropertyEnumerator(info);
}
-CORE_EXPORT void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) {
+void V8TestSpecialOperations::indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) {
const AtomicString& propertyName = AtomicString::number(index);
TestSpecialOperationsV8Internal::namedPropertyGetter(propertyName, info);
}
-CORE_EXPORT void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
+void V8TestSpecialOperations::indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
const AtomicString& propertyName = AtomicString::number(index);
TestSpecialOperationsV8Internal::namedPropertySetter(propertyName, v8Value, info);
}
-} // namespace TestSpecialOperationsV8Internal
-
const V8DOMConfiguration::MethodConfiguration V8TestSpecialOperationsMethods[] = {
- {"namedItem", TestSpecialOperationsV8Internal::namedItemMethodCallback, 0, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
+ {"namedItem", V8TestSpecialOperations::namedItemMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
};
static void installV8TestSpecialOperationsTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) {
@@ -189,10 +189,10 @@ static void installV8TestSpecialOperationsTemplate(v8::Isolate* isolate, const D
V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestSpecialOperationsMethods, WTF_ARRAY_LENGTH(V8TestSpecialOperationsMethods));
// Indexed properties
- v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestSpecialOperationsV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsV8Internal::indexedPropertySetterCallback, 0, 0, 0, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNone);
+ v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(V8TestSpecialOperations::indexedPropertyGetterCallback, V8TestSpecialOperations::indexedPropertySetterCallback, nullptr, nullptr, nullptr, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNone);
instanceTemplate->SetHandler(indexedPropertyHandlerConfig);
// Named properties
- v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestSpecialOperationsV8Internal::namedPropertyGetterCallback, TestSpecialOperationsV8Internal::namedPropertySetterCallback, TestSpecialOperationsV8Internal::namedPropertyQueryCallback, 0, TestSpecialOperationsV8Internal::namedPropertyEnumeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(int(v8::PropertyHandlerFlags::kOnlyInterceptStrings)));
+ v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(V8TestSpecialOperations::namedPropertyGetterCallback, V8TestSpecialOperations::namedPropertySetterCallback, V8TestSpecialOperations::namedPropertyQueryCallback, nullptr, V8TestSpecialOperations::namedPropertyEnumeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(int(v8::PropertyHandlerFlags::kOnlyInterceptStrings)));
instanceTemplate->SetHandler(namedPropertyHandlerConfig);
}

Powered by Google App Engine
This is Rietveld 408576698