| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 void WindowProxyManager::clearForNavigation() { | 45 void WindowProxyManager::clearForNavigation() { |
| 46 m_windowProxy->clearForNavigation(); | 46 m_windowProxy->clearForNavigation(); |
| 47 for (auto& entry : m_isolatedWorlds) | 47 for (auto& entry : m_isolatedWorlds) |
| 48 entry.value->clearForNavigation(); | 48 entry.value->clearForNavigation(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void WindowProxyManager::updateSecurityOrigin(SecurityOrigin* securityOrigin) { | 51 void WindowProxyManager::updateSecurityOrigin(SecurityOrigin* securityOrigin) { |
| 52 m_windowProxy->updateSecurityOrigin(securityOrigin); | 52 m_windowProxy->updateSecurityOrigin(securityOrigin); |
| 53 | |
| 54 for (auto& entry : m_isolatedWorlds) { | 53 for (auto& entry : m_isolatedWorlds) { |
| 55 WindowProxy* isolatedWindowProxy = entry.value.get(); | 54 WindowProxy* isolatedWindowProxy = entry.value.get(); |
| 56 if (!isolatedWindowProxy->isContextInitialized()) | |
| 57 continue; | |
| 58 SecurityOrigin* isolatedSecurityOrigin = | 55 SecurityOrigin* isolatedSecurityOrigin = |
| 59 isolatedWindowProxy->world().isolatedWorldSecurityOrigin(); | 56 isolatedWindowProxy->world().isolatedWorldSecurityOrigin(); |
| 60 isolatedWindowProxy->updateSecurityOrigin(isolatedSecurityOrigin); | 57 isolatedWindowProxy->updateSecurityOrigin(isolatedSecurityOrigin); |
| 61 } | 58 } |
| 62 } | 59 } |
| 63 | 60 |
| 64 WindowProxy* WindowProxyManager::existingWindowProxy(DOMWrapperWorld& world) { | 61 WindowProxy* WindowProxyManager::existingWindowProxy(DOMWrapperWorld& world) { |
| 65 if (world.isMainWorld()) | 62 if (world.isMainWorld()) |
| 66 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() | 63 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() |
| 67 : nullptr; | 64 : nullptr; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 87 } | 84 } |
| 88 | 85 |
| 89 WindowProxyManager::WindowProxyManager(Frame& frame) | 86 WindowProxyManager::WindowProxyManager(Frame& frame) |
| 90 : m_frame(&frame), | 87 : m_frame(&frame), |
| 91 m_isolate(v8::Isolate::GetCurrent()), | 88 m_isolate(v8::Isolate::GetCurrent()), |
| 92 m_windowProxy(WindowProxy::create(m_isolate, | 89 m_windowProxy(WindowProxy::create(m_isolate, |
| 93 &frame, | 90 &frame, |
| 94 DOMWrapperWorld::mainWorld())) {} | 91 DOMWrapperWorld::mainWorld())) {} |
| 95 | 92 |
| 96 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |