| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 class Settings; | 65 class Settings; |
| 66 class SpellCheckerClient; | 66 class SpellCheckerClient; |
| 67 class UndoStack; | 67 class UndoStack; |
| 68 class ValidationMessageClient; | 68 class ValidationMessageClient; |
| 69 class WebLayerTreeView; | 69 class WebLayerTreeView; |
| 70 | 70 |
| 71 typedef uint64_t LinkHash; | 71 typedef uint64_t LinkHash; |
| 72 | 72 |
| 73 float deviceScaleFactor(LocalFrame*); | 73 float deviceScaleFactor(LocalFrame*); |
| 74 | 74 |
| 75 class CORE_EXPORT Page final : public NoBaseWillBeGarbageCollectedFinalized<Page
>, public WillBeHeapSupplementable<Page>, public PageLifecycleNotifier, public S
ettingsDelegate, public MemoryPurgeClient { | 75 class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>, public He
apSupplementable<Page>, public PageLifecycleNotifier, public SettingsDelegate, p
ublic MemoryPurgeClient { |
| 76 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Page); | 76 USING_GARBAGE_COLLECTED_MIXIN(Page); |
| 77 USING_FAST_MALLOC_WILL_BE_REMOVED(Page); | |
| 78 WTF_MAKE_NONCOPYABLE(Page); | 77 WTF_MAKE_NONCOPYABLE(Page); |
| 79 friend class Settings; | 78 friend class Settings; |
| 80 public: | 79 public: |
| 81 // It is up to the platform to ensure that non-null clients are provided whe
re required. | 80 // It is up to the platform to ensure that non-null clients are provided whe
re required. |
| 82 struct CORE_EXPORT PageClients final { | 81 struct CORE_EXPORT PageClients final { |
| 83 STACK_ALLOCATED(); | 82 STACK_ALLOCATED(); |
| 84 WTF_MAKE_NONCOPYABLE(PageClients); | 83 WTF_MAKE_NONCOPYABLE(PageClients); |
| 85 public: | 84 public: |
| 86 PageClients(); | 85 PageClients(); |
| 87 ~PageClients(); | 86 ~PageClients(); |
| 88 | 87 |
| 89 RawPtrWillBeMember<ChromeClient> chromeClient; | 88 Member<ChromeClient> chromeClient; |
| 90 ContextMenuClient* contextMenuClient; | 89 ContextMenuClient* contextMenuClient; |
| 91 EditorClient* editorClient; | 90 EditorClient* editorClient; |
| 92 DragClient* dragClient; | 91 DragClient* dragClient; |
| 93 SpellCheckerClient* spellCheckerClient; | 92 SpellCheckerClient* spellCheckerClient; |
| 94 }; | 93 }; |
| 95 | 94 |
| 96 static PassOwnPtrWillBeRawPtr<Page> create(PageClients& pageClients) | 95 static RawPtr<Page> create(PageClients& pageClients) |
| 97 { | 96 { |
| 98 return adoptPtrWillBeNoop(new Page(pageClients)); | 97 return new Page(pageClients); |
| 99 } | 98 } |
| 100 | 99 |
| 101 // An "ordinary" page is a fully-featured page owned by a web view. | 100 // An "ordinary" page is a fully-featured page owned by a web view. |
| 102 static PassOwnPtrWillBeRawPtr<Page> createOrdinary(PageClients&); | 101 static RawPtr<Page> createOrdinary(PageClients&); |
| 103 | 102 |
| 104 ~Page() override; | 103 ~Page() override; |
| 105 | 104 |
| 106 void willBeClosed(); | 105 void willBeClosed(); |
| 107 | 106 |
| 108 using PageSet = WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>; | 107 using PageSet = PersistentHeapHashSet<WeakMember<Page>>; |
| 109 | 108 |
| 110 // Return the current set of full-fledged, ordinary pages. | 109 // Return the current set of full-fledged, ordinary pages. |
| 111 // Each created and owned by a WebView. | 110 // Each created and owned by a WebView. |
| 112 // | 111 // |
| 113 // This set does not include Pages created for other, internal purposes | 112 // This set does not include Pages created for other, internal purposes |
| 114 // (SVGImages, inspector overlays, page popups etc.) | 113 // (SVGImages, inspector overlays, page popups etc.) |
| 115 static PageSet& ordinaryPages(); | 114 static PageSet& ordinaryPages(); |
| 116 | 115 |
| 117 static void platformColorsChanged(); | 116 static void platformColorsChanged(); |
| 118 static void onMemoryPressure(); | 117 static void onMemoryPressure(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 147 | 146 |
| 148 PageAnimator& animator() { return *m_animator; } | 147 PageAnimator& animator() { return *m_animator; } |
| 149 ChromeClient& chromeClient() const { return *m_chromeClient; } | 148 ChromeClient& chromeClient() const { return *m_chromeClient; } |
| 150 AutoscrollController& autoscrollController() const { return *m_autoscrollCon
troller; } | 149 AutoscrollController& autoscrollController() const { return *m_autoscrollCon
troller; } |
| 151 DragCaretController& dragCaretController() const { return *m_dragCaretContro
ller; } | 150 DragCaretController& dragCaretController() const { return *m_dragCaretContro
ller; } |
| 152 DragController& dragController() const { return *m_dragController; } | 151 DragController& dragController() const { return *m_dragController; } |
| 153 FocusController& focusController() const { return *m_focusController; } | 152 FocusController& focusController() const { return *m_focusController; } |
| 154 ContextMenuController& contextMenuController() const { return *m_contextMenu
Controller; } | 153 ContextMenuController& contextMenuController() const { return *m_contextMenu
Controller; } |
| 155 PointerLockController& pointerLockController() const { return *m_pointerLock
Controller; } | 154 PointerLockController& pointerLockController() const { return *m_pointerLock
Controller; } |
| 156 ValidationMessageClient& validationMessageClient() const { return *m_validat
ionMessageClient; } | 155 ValidationMessageClient& validationMessageClient() const { return *m_validat
ionMessageClient; } |
| 157 void setValidationMessageClient(PassOwnPtrWillBeRawPtr<ValidationMessageClie
nt>); | 156 void setValidationMessageClient(RawPtr<ValidationMessageClient>); |
| 158 | 157 |
| 159 ScrollingCoordinator* scrollingCoordinator(); | 158 ScrollingCoordinator* scrollingCoordinator(); |
| 160 | 159 |
| 161 String mainThreadScrollingReasonsAsText(); | 160 String mainThreadScrollingReasonsAsText(); |
| 162 ClientRectList* nonFastScrollableRects(const LocalFrame*); | 161 ClientRectList* nonFastScrollableRects(const LocalFrame*); |
| 163 | 162 |
| 164 Settings& settings() const { return *m_settings; } | 163 Settings& settings() const { return *m_settings; } |
| 165 | 164 |
| 166 UseCounter& useCounter() { return m_useCounter; } | 165 UseCounter& useCounter() { return m_useCounter; } |
| 167 Deprecation& deprecation() { return m_deprecation; } | 166 Deprecation& deprecation() { return m_deprecation; } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 194 bool isPageVisible() const; | 193 bool isPageVisible() const; |
| 195 | 194 |
| 196 bool isCursorVisible() const; | 195 bool isCursorVisible() const; |
| 197 void setIsCursorVisible(bool isVisible) { m_isCursorVisible = isVisible; } | 196 void setIsCursorVisible(bool isVisible) { m_isCursorVisible = isVisible; } |
| 198 | 197 |
| 199 #if ENABLE(ASSERT) | 198 #if ENABLE(ASSERT) |
| 200 void setIsPainting(bool painting) { m_isPainting = painting; } | 199 void setIsPainting(bool painting) { m_isPainting = painting; } |
| 201 bool isPainting() const { return m_isPainting; } | 200 bool isPainting() const { return m_isPainting; } |
| 202 #endif | 201 #endif |
| 203 | 202 |
| 204 class CORE_EXPORT MultisamplingChangedObserver : public WillBeGarbageCollect
edMixin { | 203 class CORE_EXPORT MultisamplingChangedObserver : public GarbageCollectedMixi
n { |
| 205 public: | 204 public: |
| 206 virtual void multisamplingChanged(bool) = 0; | 205 virtual void multisamplingChanged(bool) = 0; |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 void addMultisamplingChangedObserver(MultisamplingChangedObserver*); | 208 void addMultisamplingChangedObserver(MultisamplingChangedObserver*); |
| 210 #if !ENABLE(OILPAN) | 209 #if !ENABLE(OILPAN) |
| 211 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); | 210 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); |
| 212 #endif | 211 #endif |
| 213 | 212 |
| 214 void didCommitLoad(LocalFrame*); | 213 void didCommitLoad(LocalFrame*); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 231 private: | 230 private: |
| 232 explicit Page(PageClients&); | 231 explicit Page(PageClients&); |
| 233 | 232 |
| 234 void initGroup(); | 233 void initGroup(); |
| 235 | 234 |
| 236 // SettingsDelegate overrides. | 235 // SettingsDelegate overrides. |
| 237 void settingsChanged(SettingsDelegate::ChangeType) override; | 236 void settingsChanged(SettingsDelegate::ChangeType) override; |
| 238 | 237 |
| 239 void compressStrings(Timer<Page>*); | 238 void compressStrings(Timer<Page>*); |
| 240 | 239 |
| 241 RefPtrWillBeMember<PageAnimator> m_animator; | 240 Member<PageAnimator> m_animator; |
| 242 const OwnPtrWillBeMember<AutoscrollController> m_autoscrollController; | 241 const Member<AutoscrollController> m_autoscrollController; |
| 243 RawPtrWillBeMember<ChromeClient> m_chromeClient; | 242 Member<ChromeClient> m_chromeClient; |
| 244 const OwnPtrWillBeMember<DragCaretController> m_dragCaretController; | 243 const Member<DragCaretController> m_dragCaretController; |
| 245 const OwnPtrWillBeMember<DragController> m_dragController; | 244 const Member<DragController> m_dragController; |
| 246 const OwnPtrWillBeMember<FocusController> m_focusController; | 245 const Member<FocusController> m_focusController; |
| 247 const OwnPtrWillBeMember<ContextMenuController> m_contextMenuController; | 246 const Member<ContextMenuController> m_contextMenuController; |
| 248 const OwnPtrWillBeMember<PointerLockController> m_pointerLockController; | 247 const Member<PointerLockController> m_pointerLockController; |
| 249 OwnPtrWillBeMember<ScrollingCoordinator> m_scrollingCoordinator; | 248 Member<ScrollingCoordinator> m_scrollingCoordinator; |
| 250 const OwnPtrWillBeMember<UndoStack> m_undoStack; | 249 const Member<UndoStack> m_undoStack; |
| 251 | 250 |
| 252 // Typically, the main frame and Page should both be owned by the embedder, | 251 // Typically, the main frame and Page should both be owned by the embedder, |
| 253 // which must call Page::willBeDestroyed() prior to destroying Page. This | 252 // which must call Page::willBeDestroyed() prior to destroying Page. This |
| 254 // call detaches the main frame and clears this pointer, thus ensuring that | 253 // call detaches the main frame and clears this pointer, thus ensuring that |
| 255 // this field only references a live main frame. | 254 // this field only references a live main frame. |
| 256 // | 255 // |
| 257 // However, there are several locations (InspectorOverlay, SVGImage, and | 256 // However, there are several locations (InspectorOverlay, SVGImage, and |
| 258 // WebPagePopupImpl) which don't hold a reference to the main frame at all | 257 // WebPagePopupImpl) which don't hold a reference to the main frame at all |
| 259 // after creating it. These are still safe because they always create a | 258 // after creating it. These are still safe because they always create a |
| 260 // Frame with a FrameView. FrameView and Frame hold references to each | 259 // Frame with a FrameView. FrameView and Frame hold references to each |
| 261 // other, thus keeping each other alive. The call to willBeDestroyed() | 260 // other, thus keeping each other alive. The call to willBeDestroyed() |
| 262 // breaks this cycle, so the frame is still properly destroyed once no | 261 // breaks this cycle, so the frame is still properly destroyed once no |
| 263 // longer needed. | 262 // longer needed. |
| 264 RawPtrWillBeMember<Frame> m_mainFrame; | 263 Member<Frame> m_mainFrame; |
| 265 | 264 |
| 266 mutable RefPtr<PluginData> m_pluginData; | 265 mutable RefPtr<PluginData> m_pluginData; |
| 267 | 266 |
| 268 EditorClient* const m_editorClient; | 267 EditorClient* const m_editorClient; |
| 269 SpellCheckerClient* const m_spellCheckerClient; | 268 SpellCheckerClient* const m_spellCheckerClient; |
| 270 OwnPtrWillBeMember<ValidationMessageClient> m_validationMessageClient; | 269 Member<ValidationMessageClient> m_validationMessageClient; |
| 271 | 270 |
| 272 UseCounter m_useCounter; | 271 UseCounter m_useCounter; |
| 273 Deprecation m_deprecation; | 272 Deprecation m_deprecation; |
| 274 OriginsUsingFeatures m_originsUsingFeatures; | 273 OriginsUsingFeatures m_originsUsingFeatures; |
| 275 | 274 |
| 276 bool m_openedByDOM; | 275 bool m_openedByDOM; |
| 277 | 276 |
| 278 bool m_tabKeyCyclesThroughElements; | 277 bool m_tabKeyCyclesThroughElements; |
| 279 bool m_defersLoading; | 278 bool m_defersLoading; |
| 280 | 279 |
| 281 float m_deviceScaleFactor; | 280 float m_deviceScaleFactor; |
| 282 | 281 |
| 283 PageVisibilityState m_visibilityState; | 282 PageVisibilityState m_visibilityState; |
| 284 | 283 |
| 285 bool m_isCursorVisible; | 284 bool m_isCursorVisible; |
| 286 | 285 |
| 287 #if ENABLE(ASSERT) | 286 #if ENABLE(ASSERT) |
| 288 bool m_isPainting; | 287 bool m_isPainting; |
| 289 #endif | 288 #endif |
| 290 | 289 |
| 291 WillBeHeapHashSet<RawPtrWillBeWeakMember<MultisamplingChangedObserver>> m_mu
ltisamplingChangedObservers; | 290 HeapHashSet<WeakMember<MultisamplingChangedObserver>> m_multisamplingChanged
Observers; |
| 292 | 291 |
| 293 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. | 292 // A pointer to all the interfaces provided to in-process Frames for this Pa
ge. |
| 294 // FIXME: Most of the members of Page should move onto FrameHost. | 293 // FIXME: Most of the members of Page should move onto FrameHost. |
| 295 OwnPtrWillBeMember<FrameHost> m_frameHost; | 294 Member<FrameHost> m_frameHost; |
| 296 | 295 |
| 297 OwnPtrWillBeMember<MemoryPurgeController> m_memoryPurgeController; | 296 Member<MemoryPurgeController> m_memoryPurgeController; |
| 298 | 297 |
| 299 Timer<Page> m_timerForCompressStrings; | 298 Timer<Page> m_timerForCompressStrings; |
| 300 }; | 299 }; |
| 301 | 300 |
| 302 extern template class CORE_EXTERN_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; | 301 extern template class CORE_EXTERN_TEMPLATE_EXPORT HeapSupplement<Page>; |
| 303 | 302 |
| 304 } // namespace blink | 303 } // namespace blink |
| 305 | 304 |
| 306 #endif // Page_h | 305 #endif // Page_h |
| OLD | NEW |