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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.cpp

Issue 1466733006: Revert of Switch V8HiddenValue from hidden values to privates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | 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/core/v8/V8HiddenValue.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.cpp b/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.cpp
index 478729ed4873cbb409a88d73f2c2988a44b6a951..c0e1cc64ca5db06b60c0461146fdd027c87356c2 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.cpp
@@ -25,25 +25,17 @@
v8::Local<v8::Value> V8HiddenValue::getHiddenValue(ScriptState* scriptState, v8::Local<v8::Object> object, v8::Local<v8::String> key)
{
- v8::Local<v8::Context> context = scriptState->context();
- v8::Local<v8::Private> privateKey = v8::Private::ForApi(scriptState->isolate(), key);
- v8::Local<v8::Value> value;
- // Callsites interpret an empty handle has absence of a result.
- if (!v8CallBoolean(object->HasPrivate(context, privateKey)))
- return v8::Local<v8::Value>();
- if (object->GetPrivate(context, privateKey).ToLocal(&value))
- return value;
- return v8::Local<v8::Value>();
+ return object->GetHiddenValue(key);
}
bool V8HiddenValue::setHiddenValue(ScriptState* scriptState, v8::Local<v8::Object> object, v8::Local<v8::String> key, v8::Local<v8::Value> value)
{
- return v8CallBoolean(object->SetPrivate(scriptState->context(), v8::Private::ForApi(scriptState->isolate(), key), value));
+ return object->SetHiddenValue(key, value);
}
bool V8HiddenValue::deleteHiddenValue(ScriptState* scriptState, v8::Local<v8::Object> object, v8::Local<v8::String> key)
{
- return v8CallBoolean(object->DeletePrivate(scriptState->context(), v8::Private::ForApi(scriptState->isolate(), key)));
+ return object->DeleteHiddenValue(key);
}
v8::Local<v8::Value> V8HiddenValue::getHiddenValueFromMainWorldWrapper(ScriptState* scriptState, ScriptWrappable* wrappable, v8::Local<v8::String> key)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698