| 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 "config.h" | 5 #include "config.h" |
| 6 #include "bindings/core/v8/WindowProxyManager.h" | 6 #include "bindings/core/v8/WindowProxyManager.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/DOMWrapperWorld.h" | 8 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 9 #include "bindings/core/v8/WindowProxy.h" | 9 #include "bindings/core/v8/WindowProxy.h" |
| 10 #include "core/frame/Frame.h" | 10 #include "core/frame/Frame.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 windowProxy = iter->value.get(); | 40 windowProxy = iter->value.get(); |
| 41 } else { | 41 } else { |
| 42 OwnPtrWillBeRawPtr<WindowProxy> isolatedWorldWindowProxy = WindowPro
xy::create(m_isolate, m_frame, world); | 42 OwnPtrWillBeRawPtr<WindowProxy> isolatedWorldWindowProxy = WindowPro
xy::create(m_isolate, m_frame, world); |
| 43 windowProxy = isolatedWorldWindowProxy.get(); | 43 windowProxy = isolatedWorldWindowProxy.get(); |
| 44 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.relea
se()); | 44 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.relea
se()); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 return windowProxy; | 47 return windowProxy; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void WindowProxyManager::clearForClose() | 50 void WindowProxyManager::clearWindowProxy() |
| 51 { | 51 { |
| 52 m_windowProxy->clearForClose(); | 52 m_windowProxy->clearWindowProxy(); |
| 53 for (auto& entry : m_isolatedWorlds) | 53 for (auto& entry : m_isolatedWorlds) |
| 54 entry.value->clearForClose(); | 54 entry.value->clearWindowProxy(); |
| 55 } | |
| 56 | |
| 57 void WindowProxyManager::clearForNavigation() | |
| 58 { | |
| 59 m_windowProxy->clearForNavigation(); | |
| 60 for (auto& entry : m_isolatedWorlds) | |
| 61 entry.value->clearForNavigation(); | |
| 62 } | 55 } |
| 63 | 56 |
| 64 WindowProxy* WindowProxyManager::existingWindowProxy(DOMWrapperWorld& world) | 57 WindowProxy* WindowProxyManager::existingWindowProxy(DOMWrapperWorld& world) |
| 65 { | 58 { |
| 66 if (world.isMainWorld()) | 59 if (world.isMainWorld()) |
| 67 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() : nul
lptr; | 60 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() : nul
lptr; |
| 68 | 61 |
| 69 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()); | 62 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()); |
| 70 if (iter == m_isolatedWorlds.end()) | 63 if (iter == m_isolatedWorlds.end()) |
| 71 return nullptr; | 64 return nullptr; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 97 } | 90 } |
| 98 | 91 |
| 99 WindowProxyManager::WindowProxyManager(Frame& frame) | 92 WindowProxyManager::WindowProxyManager(Frame& frame) |
| 100 : m_frame(&frame) | 93 : m_frame(&frame) |
| 101 , m_isolate(v8::Isolate::GetCurrent()) | 94 , m_isolate(v8::Isolate::GetCurrent()) |
| 102 , m_windowProxy(WindowProxy::create(m_isolate, &frame, DOMWrapperWorld::main
World())) | 95 , m_windowProxy(WindowProxy::create(m_isolate, &frame, DOMWrapperWorld::main
World())) |
| 103 { | 96 { |
| 104 } | 97 } |
| 105 | 98 |
| 106 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |