| 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 22 matching lines...) Expand all Loading... |
| 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 "core/CoreExport.h" | 36 #include "core/CoreExport.h" |
| 37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 38 #include "v8/include/v8.h" | 38 #include "v8/include/v8.h" |
| 39 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class DOMWindow; |
| 43 class Frame; | 44 class Frame; |
| 44 class ScriptController; | 45 class ScriptController; |
| 45 | 46 |
| 46 // WindowProxy implements the split window model of a window for a frame. In the | 47 // WindowProxy implements the split window model of a window for a frame. In the |
| 47 // HTML standard, the split window model is composed of the Window interface | 48 // HTML standard, the split window model is composed of the Window interface |
| 48 // (the inner global object) and the WindowProxy interface (the outer global | 49 // (the inner global object) and the WindowProxy interface (the outer global |
| 49 // proxy). | 50 // proxy). |
| 50 // | 51 // |
| 51 // The Window interface is backed by the Blink DOMWindow C++ implementation. | 52 // The Window interface is backed by the Blink DOMWindow C++ implementation. |
| 52 // In contrast, the WindowProxy interface does not have a corresponding | 53 // In contrast, the WindowProxy interface does not have a corresponding |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ContextDetached, | 157 ContextDetached, |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 WindowProxy(v8::Isolate*, Frame&, RefPtr<DOMWrapperWorld>); | 160 WindowProxy(v8::Isolate*, Frame&, RefPtr<DOMWrapperWorld>); |
| 160 | 161 |
| 161 virtual void initialize() = 0; | 162 virtual void initialize() = 0; |
| 162 | 163 |
| 163 enum GlobalDetachmentBehavior { DoNotDetachGlobal, DetachGlobal }; | 164 enum GlobalDetachmentBehavior { DoNotDetachGlobal, DetachGlobal }; |
| 164 virtual void disposeContext(GlobalDetachmentBehavior) = 0; | 165 virtual void disposeContext(GlobalDetachmentBehavior) = 0; |
| 165 | 166 |
| 167 WARN_UNUSED_RESULT v8::Local<v8::Object> associateWithWrapper( |
| 168 DOMWindow*, |
| 169 const WrapperTypeInfo*, |
| 170 v8::Local<v8::Object> wrapper); |
| 171 |
| 166 v8::Isolate* isolate() const { return m_isolate; } | 172 v8::Isolate* isolate() const { return m_isolate; } |
| 167 Frame* frame() const { return m_frame.get(); } | 173 Frame* frame() const { return m_frame.get(); } |
| 168 | 174 |
| 169 #if DCHECK_IS_ON() | 175 #if DCHECK_IS_ON() |
| 170 void didAttachGlobalObject() { m_isGlobalObjectAttached = true; } | 176 void didAttachGlobalObject() { m_isGlobalObjectAttached = true; } |
| 171 void didDetachGlobalObject() { m_isGlobalObjectAttached = false; } | 177 void didDetachGlobalObject() { m_isGlobalObjectAttached = false; } |
| 172 #endif | 178 #endif |
| 173 | 179 |
| 174 private: | 180 private: |
| 175 v8::Isolate* const m_isolate; | 181 v8::Isolate* const m_isolate; |
| 176 const Member<Frame> m_frame; | 182 const Member<Frame> m_frame; |
| 177 #if DCHECK_IS_ON() | 183 #if DCHECK_IS_ON() |
| 178 bool m_isGlobalObjectAttached = false; | 184 bool m_isGlobalObjectAttached = false; |
| 179 #endif | 185 #endif |
| 180 | 186 |
| 181 protected: | 187 protected: |
| 182 // TODO(dcheng): Consider making these private and using getters. | 188 // TODO(dcheng): Consider making these private and using getters. |
| 183 const RefPtr<DOMWrapperWorld> m_world; | 189 const RefPtr<DOMWrapperWorld> m_world; |
| 184 ScopedPersistent<v8::Object> m_globalProxy; | 190 ScopedPersistent<v8::Object> m_globalProxy; |
| 185 Lifecycle m_lifecycle; | 191 Lifecycle m_lifecycle; |
| 186 }; | 192 }; |
| 187 | 193 |
| 188 } // namespace blink | 194 } // namespace blink |
| 189 | 195 |
| 190 #endif // WindowProxy_h | 196 #endif // WindowProxy_h |
| OLD | NEW |