| 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 "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <v8.h> | 12 #include <v8.h> |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class DOMWrapperWorld; | 16 class DOMWrapperWorld; |
| 17 class Frame; | 17 class Frame; |
| 18 class ScriptState; | 18 class ScriptState; |
| 19 class SecurityOrigin; | 19 class SecurityOrigin; |
| 20 class WindowProxy; | 20 class WindowProxy; |
| 21 | 21 |
| 22 class CORE_EXPORT WindowProxyManager final : public NoBaseWillBeGarbageCollected
Finalized<WindowProxyManager> { | 22 class CORE_EXPORT WindowProxyManager final : public NoBaseWillBeGarbageCollected
Finalized<WindowProxyManager> { |
| 23 USING_FAST_MALLOC_WILL_BE_REMOVED(WindowProxyManager); | 23 USING_FAST_MALLOC_WILL_BE_REMOVED(WindowProxyManager); |
| 24 public: | 24 public: |
| 25 static PassOwnPtrWillBeRawPtr<WindowProxyManager> create(Frame&); | 25 static PassOwnPtrWillBeRawPtr<WindowProxyManager> create(Frame&); |
| 26 | 26 |
| 27 ~WindowProxyManager(); | 27 ~WindowProxyManager(); |
| 28 DECLARE_TRACE(); | 28 DECLARE_TRACE(); |
| 29 | 29 |
| 30 Frame* frame() const; | 30 Frame* frame() const { return m_frame.get(); } |
| 31 v8::Isolate* isolate() const { return m_isolate; } | 31 v8::Isolate* isolate() const { return m_isolate; } |
| 32 WindowProxy* mainWorldProxy() const; | 32 WindowProxy* mainWorldProxy() const { return m_windowProxy.get(); } |
| 33 | 33 |
| 34 WindowProxy* windowProxy(DOMWrapperWorld&); | 34 WindowProxy* windowProxy(DOMWrapperWorld&); |
| 35 | 35 |
| 36 void clearForClose(); | 36 void clearForClose(); |
| 37 void clearForNavigation(); | 37 void clearForNavigation(); |
| 38 | 38 |
| 39 // For devtools: | 39 // For devtools: |
| 40 WindowProxy* existingWindowProxy(DOMWrapperWorld&); | 40 WindowProxy* existingWindowProxy(DOMWrapperWorld&); |
| 41 void collectIsolatedContexts(Vector<std::pair<ScriptState*, SecurityOrigin*>
>&); | 41 void collectIsolatedContexts(Vector<std::pair<ScriptState*, SecurityOrigin*>
>&); |
| 42 | 42 |
| 43 void releaseGlobals(HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>&); | 43 void releaseGlobals(HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>&); |
| 44 void setGlobals(const HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>&); | 44 void setGlobals(const HashMap<DOMWrapperWorld*, v8::Local<v8::Object>>&); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 typedef WillBeHeapHashMap<int, OwnPtrWillBeMember<WindowProxy>> IsolatedWorl
dMap; | 47 typedef WillBeHeapHashMap<int, OwnPtrWillBeMember<WindowProxy>> IsolatedWorl
dMap; |
| 48 | 48 |
| 49 explicit WindowProxyManager(Frame&); | 49 explicit WindowProxyManager(Frame&); |
| 50 | 50 |
| 51 RawPtrWillBeMember<Frame> m_frame; | 51 RawPtrWillBeMember<Frame> m_frame; |
| 52 v8::Isolate* const m_isolate; | 52 v8::Isolate* const m_isolate; |
| 53 | 53 |
| 54 const OwnPtrWillBeMember<WindowProxy> m_windowProxy; | 54 const OwnPtrWillBeMember<WindowProxy> m_windowProxy; |
| 55 IsolatedWorldMap m_isolatedWorlds; | 55 IsolatedWorldMap m_isolatedWorlds; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace blink | 58 } // namespace blink |
| 59 | 59 |
| 60 #endif // WindowProxyManager_h | 60 #endif // WindowProxyManager_h |
| OLD | NEW |