| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WindowProxy_h | 31 #ifndef WindowProxy_h |
| 32 #define WindowProxy_h | 32 #define WindowProxy_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/DOMWrapperWorld.h" | 34 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 35 #include "bindings/core/v8/ScopedPersistent.h" | 35 #include "bindings/core/v8/ScopedPersistent.h" |
| 36 #include "bindings/core/v8/ScriptState.h" | 36 #include "bindings/core/v8/ScriptState.h" |
| 37 #include "platform/heap/Handle.h" |
| 37 #include "platform/weborigin/SecurityOrigin.h" | 38 #include "platform/weborigin/SecurityOrigin.h" |
| 38 #include "wtf/HashMap.h" | 39 #include "wtf/HashMap.h" |
| 39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
| 40 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
| 41 #include "wtf/text/AtomicString.h" | 42 #include "wtf/text/AtomicString.h" |
| 42 #include <v8.h> | 43 #include <v8.h> |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| 46 class LocalFrame; | 47 class LocalFrame; |
| 47 class HTMLDocument; | 48 class HTMLDocument; |
| 48 class SecurityOrigin; | 49 class SecurityOrigin; |
| 49 | 50 |
| 50 // WindowProxy represents all the per-global object state for a LocalFrame that | 51 // WindowProxy represents all the per-global object state for a LocalFrame that |
| 51 // persist between navigations. | 52 // persist between navigations. |
| 52 class WindowProxy { | 53 class WindowProxy final : public NoBaseWillBeGarbageCollectedFinalized<WindowPro
xy> { |
| 53 public: | 54 public: |
| 54 static PassOwnPtr<WindowProxy> create(LocalFrame*, DOMWrapperWorld&, v8::Iso
late*); | 55 static PassOwnPtrWillBeRawPtr<WindowProxy> create(LocalFrame*, DOMWrapperWor
ld&, v8::Isolate*); |
| 56 |
| 57 ~WindowProxy(); |
| 58 void trace(Visitor*); |
| 55 | 59 |
| 56 v8::Local<v8::Context> context() const { return m_scriptState ? m_scriptStat
e->context() : v8::Local<v8::Context>(); } | 60 v8::Local<v8::Context> context() const { return m_scriptState ? m_scriptStat
e->context() : v8::Local<v8::Context>(); } |
| 57 ScriptState* scriptState() const { return m_scriptState.get(); } | 61 ScriptState* scriptState() const { return m_scriptState.get(); } |
| 58 | 62 |
| 59 // Update document object of the frame. | 63 // Update document object of the frame. |
| 60 void updateDocument(); | 64 void updateDocument(); |
| 61 | 65 |
| 62 void namedItemAdded(HTMLDocument*, const AtomicString&); | 66 void namedItemAdded(HTMLDocument*, const AtomicString&); |
| 63 void namedItemRemoved(HTMLDocument*, const AtomicString&); | 67 void namedItemRemoved(HTMLDocument*, const AtomicString&); |
| 64 | 68 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 95 // deletes the document wrapper from the global object. | 99 // deletes the document wrapper from the global object. |
| 96 void updateDocumentProperty(); | 100 void updateDocumentProperty(); |
| 97 void clearDocumentProperty(); | 101 void clearDocumentProperty(); |
| 98 | 102 |
| 99 // Updates Activity Logger for the current context. | 103 // Updates Activity Logger for the current context. |
| 100 void updateActivityLogger(); | 104 void updateActivityLogger(); |
| 101 | 105 |
| 102 void createContext(); | 106 void createContext(); |
| 103 bool installDOMWindow(); | 107 bool installDOMWindow(); |
| 104 | 108 |
| 105 static WindowProxy* enteredIsolatedWorldContext(); | 109 RawPtrWillBeMember<LocalFrame> m_frame; |
| 106 | |
| 107 LocalFrame* m_frame; | |
| 108 v8::Isolate* m_isolate; | 110 v8::Isolate* m_isolate; |
| 109 RefPtr<ScriptState> m_scriptState; | 111 RefPtr<ScriptState> m_scriptState; |
| 110 RefPtr<DOMWrapperWorld> m_world; | 112 RefPtr<DOMWrapperWorld> m_world; |
| 111 ScopedPersistent<v8::Object> m_global; | 113 ScopedPersistent<v8::Object> m_global; |
| 112 ScopedPersistent<v8::Object> m_document; | 114 ScopedPersistent<v8::Object> m_document; |
| 113 }; | 115 }; |
| 114 | 116 |
| 115 } // namespace blink | 117 } // namespace blink |
| 116 | 118 |
| 117 #endif // WindowProxy_h | 119 #endif // WindowProxy_h |
| OLD | NEW |