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

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

Issue 2781443002: [Bindings] Specialize WindowDocument symbol in V8PrivateProperty (Closed)
Patch Set: Rebase 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/core/v8/V8PrivateProperty.h ('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/core/v8/V8PrivateProperty.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp
index 39561d575c5e187259b069cf6977fff63e25926a..fe6c41f6d23fe177b05680dd951eab693be39f8d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp
@@ -18,14 +18,15 @@ v8::Local<v8::Value> V8PrivateProperty::Symbol::getFromMainWorld(
}
v8::Local<v8::Private> V8PrivateProperty::createV8Private(v8::Isolate* isolate,
- const char* symbol,
- size_t length) {
- v8::Local<v8::String> str =
- v8::String::NewFromOneByte(
- isolate, reinterpret_cast<const uint8_t*>(symbol),
- v8::NewStringType::kNormal, static_cast<int>(length))
- .ToLocalChecked();
- return v8::Private::New(isolate, str);
+ const char* symbol) {
+ return v8::Private::New(isolate, v8String(isolate, symbol));
+}
+
+v8::Local<v8::Private> V8PrivateProperty::createCachedV8Private(
+ v8::Isolate* isolate,
+ const char* symbol) {
+ // Use ForApi() to get the same Private symbol which is not cached in Chrome.
+ return v8::Private::ForApi(isolate, v8String(isolate, symbol));
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698