Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bindings/core/v8/ToV8.h" | 5 #include "bindings/core/v8/ToV8.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/WindowProxy.h" | 7 #include "bindings/core/v8/WindowProxy.h" |
| 8 #include "bindings/core/v8/WindowProxyManager.h" | |
| 8 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
| 9 #include "core/frame/DOMWindow.h" | 10 #include "core/frame/DOMWindow.h" |
| 10 #include "core/frame/Frame.h" | 11 #include "core/frame/Frame.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 v8::Local<v8::Value> ToV8(DOMWindow* window, | 15 v8::Local<v8::Value> ToV8(DOMWindow* window, |
| 15 v8::Local<v8::Object> creationContext, | 16 v8::Local<v8::Object> creationContext, |
| 16 v8::Isolate* isolate) { | 17 v8::Isolate* isolate) { |
| 17 // Notice that we explicitly ignore creationContext because the DOMWindow | 18 // Notice that we explicitly ignore creationContext because the DOMWindow |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 33 v8::Local<v8::Object> creationContext, | 34 v8::Local<v8::Object> creationContext, |
| 34 v8::Isolate* isolate) { | 35 v8::Isolate* isolate) { |
| 35 if (UNLIKELY(!impl)) | 36 if (UNLIKELY(!impl)) |
| 36 return v8::Null(isolate); | 37 return v8::Null(isolate); |
| 37 | 38 |
| 38 if (impl->interfaceName() == EventTargetNames::DOMWindow) | 39 if (impl->interfaceName() == EventTargetNames::DOMWindow) |
| 39 return ToV8(static_cast<DOMWindow*>(impl), creationContext, isolate); | 40 return ToV8(static_cast<DOMWindow*>(impl), creationContext, isolate); |
| 40 return ToV8(static_cast<ScriptWrappable*>(impl), creationContext, isolate); | 41 return ToV8(static_cast<ScriptWrappable*>(impl), creationContext, isolate); |
| 41 } | 42 } |
| 42 | 43 |
| 44 v8::Local<v8::Value> ToV8(WindowProxyManagerBase* windowProxyManager, | |
| 45 v8::Local<v8::Object> creationContext, | |
| 46 v8::Isolate* isolate) { | |
| 47 // Notice that we explicitly ignore creationContext because the DOMWindow | |
| 48 // has its own creationContext. | |
| 49 return windowProxyManager->windowProxy(DOMWrapperWorld::current(isolate)) | |
| 50 ->globalIfNotDetached(); | |
|
Yuki
2017/01/18 07:31:43
I think globalIfNotDetached() is not equivalent to
| |
| 51 } | |
| 52 | |
| 43 } // namespace blink | 53 } // namespace blink |
| OLD | NEW |