Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/Location.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/Location.cpp b/third_party/WebKit/Source/core/frame/Location.cpp |
| index 9a1ebf41694440f2ae194ad213f68852924d19bb..f3eec9124f58cca98e7c0255e7f66c22a39ccfcc 100644 |
| --- a/third_party/WebKit/Source/core/frame/Location.cpp |
| +++ b/third_party/WebKit/Source/core/frame/Location.cpp |
| @@ -31,6 +31,7 @@ |
| #include "bindings/core/v8/BindingSecurity.h" |
| #include "bindings/core/v8/ExceptionState.h" |
| #include "bindings/core/v8/V8DOMActivityLogger.h" |
| +#include "bindings/core/v8/V8DOMWrapper.h" |
| #include "core/dom/DOMURLUtilsReadOnly.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/ExceptionCode.h" |
| @@ -119,6 +120,21 @@ DOMStringList* Location::ancestorOrigins() const { |
| return origins; |
| } |
| +v8::Local<v8::Object> Location::crossOriginWrapper(v8::Isolate* isolate) { |
|
Yuki
2017/01/24 10:31:05
I guess it's better to rename this function to rem
|
| + if (m_crossOriginWrapper.IsEmpty()) { |
| + m_crossOriginWrapper.Reset( |
| + isolate, wrapperTypeInfo() |
| + ->domTemplate(isolate, DOMWrapperWorld::world( |
|
dcheng
2017/01/24 09:40:47
However, this makes me nervous. Is there a way to
Yuki
2017/01/24 10:31:04
No, because we have main-world-specific optimizati
dcheng
2017/01/24 10:41:59
Can you point me at the main world optimizations?
Yuki
2017/01/24 10:53:00
I meant [PerWorldBindings] extended attribute, but
|
| + isolate->GetCurrentContext())) |
| + ->NewRemoteInstance() |
|
dcheng
2017/01/24 09:40:47
+jochen
Sharing a remote instance like this shoul
Yuki
2017/01/24 10:31:04
If it's okay, then I'd like to have a comment here
|
| + .ToLocalChecked()); |
| + V8DOMWrapper::setNativeInfo(isolate, m_crossOriginWrapper.Get(isolate), |
| + wrapperTypeInfo(), this); |
| + m_crossOriginWrapper.SetWrapperClassId(wrapperTypeInfo()->wrapperClassId); |
| + } |
| + return m_crossOriginWrapper.Get(isolate); |
| +} |
| + |
| String Location::hash() const { |
| if (!m_frame) |
| return String(); |