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

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

Issue 2751263002: [Bindings] Cache handles for dictionary keys on V8PerIsolateData. (Closed)
Patch Set: const Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp
index 4d395e5b85baff576b0e94849ec57a2bb627f76b..83b508e9f20ab59c80a834c47088d3122bc126c7 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp
@@ -17,6 +17,14 @@
namespace blink {
+static const v8::Eternal<v8::Name>* eternalV8TestPermissiveDictionaryKeys(v8::Isolate* isolate) {
+ static const char* const kKeys[] = {
+ "booleanMember",
+ };
+ return V8PerIsolateData::from(isolate)->findOrCreateKeys(
+ kKeys, kKeys, WTF_ARRAY_LENGTH(kKeys));
+}
+
void V8TestPermissiveDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, TestPermissiveDictionary& impl, ExceptionState& exceptionState) {
if (isUndefinedOrNull(v8Value)) {
return;
@@ -28,9 +36,11 @@ void V8TestPermissiveDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Valu
v8::Local<v8::Object> v8Object = v8Value.As<v8::Object>();
ALLOW_UNUSED_LOCAL(v8Object);
+ const v8::Eternal<v8::Name>* keys = eternalV8TestPermissiveDictionaryKeys(isolate);
v8::TryCatch block(isolate);
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::Value> booleanMemberValue;
- if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "booleanMember")).ToLocal(&booleanMemberValue)) {
+ if (!v8Object->Get(context, keys[0].Get(isolate)).ToLocal(&booleanMemberValue)) {
exceptionState.rethrowV8Exception(block.Exception());
return;
}
@@ -52,8 +62,10 @@ v8::Local<v8::Value> TestPermissiveDictionary::toV8Impl(v8::Local<v8::Object> cr
}
bool toV8TestPermissiveDictionary(const TestPermissiveDictionary& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) {
+ const v8::Eternal<v8::Name>* keys = eternalV8TestPermissiveDictionaryKeys(isolate);
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();
if (impl.hasBooleanMember()) {
- if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8AtomicString(isolate, "booleanMember"), v8Boolean(impl.booleanMember(), isolate))))
+ if (!v8CallBoolean(dictionary->CreateDataProperty(context, keys[0].Get(isolate), v8Boolean(impl.booleanMember(), isolate))))
return false;
}
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698