| 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 #ifndef WindowProxyManager_h | 5 #ifndef WindowProxyManager_h |
| 6 #define WindowProxyManager_h | 6 #define WindowProxyManager_h |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "bindings/core/v8/LocalWindowProxy.h" | 10 #include "bindings/core/v8/LocalWindowProxy.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 class WindowProxyManagerBase : public GarbageCollected<WindowProxyManagerBase> { | 24 class WindowProxyManagerBase : public GarbageCollected<WindowProxyManagerBase> { |
| 25 public: | 25 public: |
| 26 DECLARE_TRACE(); | 26 DECLARE_TRACE(); |
| 27 | 27 |
| 28 v8::Isolate* isolate() const { return m_isolate; } | 28 v8::Isolate* isolate() const { return m_isolate; } |
| 29 | 29 |
| 30 void clearForClose(); | 30 void clearForClose(); |
| 31 void CORE_EXPORT clearForNavigation(); | 31 void CORE_EXPORT clearForNavigation(); |
| 32 | 32 |
| 33 void CORE_EXPORT | 33 // Globals are passed in a vector to maintain their order: global object for |
| 34 releaseGlobals(HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>&); | 34 // the main world is always first. This is needed to prevent bugs like |
| 35 void CORE_EXPORT | 35 // https://crbug.com/700077. |
| 36 setGlobals(const HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>&); | 36 using GlobalsVector = |
| 37 Vector<std::pair<DOMWrapperWorld*, v8::Local<v8::Object>>>; |
| 38 void CORE_EXPORT releaseGlobals(GlobalsVector&); |
| 39 void CORE_EXPORT setGlobals(const GlobalsVector&); |
| 37 | 40 |
| 38 protected: | 41 protected: |
| 39 using IsolatedWorldMap = HeapHashMap<int, Member<WindowProxy>>; | 42 using IsolatedWorldMap = HeapHashMap<int, Member<WindowProxy>>; |
| 40 | 43 |
| 41 explicit WindowProxyManagerBase(Frame&); | 44 explicit WindowProxyManagerBase(Frame&); |
| 42 | 45 |
| 43 Frame* frame() const { return m_frame; } | 46 Frame* frame() const { return m_frame; } |
| 44 WindowProxy* mainWorldProxy() const { return m_windowProxy.get(); } | 47 WindowProxy* mainWorldProxy() const { return m_windowProxy.get(); } |
| 45 WindowProxy* windowProxy(DOMWrapperWorld&); | 48 WindowProxy* windowProxy(DOMWrapperWorld&); |
| 46 | 49 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 102 } |
| 100 | 103 |
| 101 private: | 104 private: |
| 102 explicit RemoteWindowProxyManager(RemoteFrame& frame) | 105 explicit RemoteWindowProxyManager(RemoteFrame& frame) |
| 103 : WindowProxyManagerImplHelper<RemoteFrame, RemoteWindowProxy>(frame) {} | 106 : WindowProxyManagerImplHelper<RemoteFrame, RemoteWindowProxy>(frame) {} |
| 104 }; | 107 }; |
| 105 | 108 |
| 106 } // namespace blink | 109 } // namespace blink |
| 107 | 110 |
| 108 #endif // WindowProxyManager_h | 111 #endif // WindowProxyManager_h |
| OLD | NEW |