| 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/WindowProxyManager.h" | 5 #include "bindings/core/v8/WindowProxyManager.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/DOMWrapperWorld.h" | 7 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 8 #include "bindings/core/v8/WindowProxy.h" | 8 #include "bindings/core/v8/WindowProxy.h" |
| 9 #include "core/frame/Frame.h" | 9 #include "core/frame/Frame.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 PassOwnPtrWillBeRawPtr<WindowProxyManager> WindowProxyManager::create(Frame& fra
me) | 13 RawPtr<WindowProxyManager> WindowProxyManager::create(Frame& frame) |
| 14 { | 14 { |
| 15 return adoptPtrWillBeNoop(new WindowProxyManager(frame)); | 15 return (new WindowProxyManager(frame)); |
| 16 } | 16 } |
| 17 | 17 |
| 18 WindowProxyManager::~WindowProxyManager() | 18 WindowProxyManager::~WindowProxyManager() |
| 19 { | 19 { |
| 20 } | 20 } |
| 21 | 21 |
| 22 DEFINE_TRACE(WindowProxyManager) | 22 DEFINE_TRACE(WindowProxyManager) |
| 23 { | 23 { |
| 24 #if ENABLE(OILPAN) | 24 #if ENABLE(OILPAN) |
| 25 visitor->trace(m_frame); | 25 visitor->trace(m_frame); |
| 26 visitor->trace(m_windowProxy); | 26 visitor->trace(m_windowProxy); |
| 27 visitor->trace(m_isolatedWorlds); | 27 visitor->trace(m_isolatedWorlds); |
| 28 #endif | 28 #endif |
| 29 } | 29 } |
| 30 | 30 |
| 31 WindowProxy* WindowProxyManager::windowProxy(DOMWrapperWorld& world) | 31 WindowProxy* WindowProxyManager::windowProxy(DOMWrapperWorld& world) |
| 32 { | 32 { |
| 33 WindowProxy* windowProxy = nullptr; | 33 WindowProxy* windowProxy = nullptr; |
| 34 if (world.isMainWorld()) { | 34 if (world.isMainWorld()) { |
| 35 windowProxy = m_windowProxy.get(); | 35 windowProxy = m_windowProxy.get(); |
| 36 } else { | 36 } else { |
| 37 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId())
; | 37 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId())
; |
| 38 if (iter != m_isolatedWorlds.end()) { | 38 if (iter != m_isolatedWorlds.end()) { |
| 39 windowProxy = iter->value.get(); | 39 windowProxy = iter->value.get(); |
| 40 } else { | 40 } else { |
| 41 OwnPtrWillBeRawPtr<WindowProxy> isolatedWorldWindowProxy = WindowPro
xy::create(m_isolate, m_frame, world); | 41 RawPtr<WindowProxy> isolatedWorldWindowProxy = WindowProxy::create(m
_isolate, m_frame, world); |
| 42 windowProxy = isolatedWorldWindowProxy.get(); | 42 windowProxy = isolatedWorldWindowProxy.get(); |
| 43 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.relea
se()); | 43 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.relea
se()); |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 return windowProxy; | 46 return windowProxy; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void WindowProxyManager::clearForClose() | 49 void WindowProxyManager::clearForClose() |
| 50 { | 50 { |
| 51 m_windowProxy->clearForClose(); | 51 m_windowProxy->clearForClose(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 WindowProxyManager::WindowProxyManager(Frame& frame) | 98 WindowProxyManager::WindowProxyManager(Frame& frame) |
| 99 : m_frame(&frame) | 99 : m_frame(&frame) |
| 100 , m_isolate(v8::Isolate::GetCurrent()) | 100 , m_isolate(v8::Isolate::GetCurrent()) |
| 101 , m_windowProxy(WindowProxy::create(m_isolate, &frame, DOMWrapperWorld::main
World())) | 101 , m_windowProxy(WindowProxy::create(m_isolate, &frame, DOMWrapperWorld::main
World())) |
| 102 { | 102 { |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace blink | 105 } // namespace blink |
| OLD | NEW |