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/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 18 matching lines...) Expand all Loading... | |
| 29 WindowProxy* WindowProxyManager::windowProxy(DOMWrapperWorld& world) | 29 WindowProxy* WindowProxyManager::windowProxy(DOMWrapperWorld& world) |
| 30 { | 30 { |
| 31 WindowProxy* windowProxy = nullptr; | 31 WindowProxy* windowProxy = nullptr; |
| 32 if (world.isMainWorld()) { | 32 if (world.isMainWorld()) { |
| 33 windowProxy = m_windowProxy.get(); | 33 windowProxy = m_windowProxy.get(); |
| 34 } else { | 34 } else { |
| 35 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()) ; | 35 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()) ; |
| 36 if (iter != m_isolatedWorlds.end()) { | 36 if (iter != m_isolatedWorlds.end()) { |
| 37 windowProxy = iter->value.get(); | 37 windowProxy = iter->value.get(); |
| 38 } else { | 38 } else { |
| 39 RawPtr<WindowProxy> isolatedWorldWindowProxy = WindowProxy::create(m _isolate, m_frame, world); | 39 WindowProxy* isolatedWorldWindowProxy = WindowProxy::create(m_isolat e, m_frame, world); |
|
sof
2016/04/12 07:29:54
Shorten out the |isloatedWorldWindowProxy| interme
| |
| 40 windowProxy = isolatedWorldWindowProxy.get(); | 40 windowProxy = isolatedWorldWindowProxy; |
| 41 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.relea se()); | 41 m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 return windowProxy; | 44 return windowProxy; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void WindowProxyManager::clearForClose() | 47 void WindowProxyManager::clearForClose() |
| 48 { | 48 { |
| 49 m_windowProxy->clearForClose(); | 49 m_windowProxy->clearForClose(); |
| 50 for (auto& entry : m_isolatedWorlds) | 50 for (auto& entry : m_isolatedWorlds) |
| 51 entry.value->clearForClose(); | 51 entry.value->clearForClose(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 } | 94 } |
| 95 | 95 |
| 96 WindowProxyManager::WindowProxyManager(Frame& frame) | 96 WindowProxyManager::WindowProxyManager(Frame& frame) |
| 97 : m_frame(&frame) | 97 : m_frame(&frame) |
| 98 , m_isolate(v8::Isolate::GetCurrent()) | 98 , m_isolate(v8::Isolate::GetCurrent()) |
| 99 , m_windowProxy(WindowProxy::create(m_isolate, &frame, DOMWrapperWorld::main World())) | 99 , m_windowProxy(WindowProxy::create(m_isolate, &frame, DOMWrapperWorld::main World())) |
| 100 { | 100 { |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |