| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 typedef uint64_t LinkHash; | 69 typedef uint64_t LinkHash; |
| 70 | 70 |
| 71 float deviceScaleFactor(LocalFrame*); | 71 float deviceScaleFactor(LocalFrame*); |
| 72 | 72 |
| 73 class CORE_EXPORT Page final : public NoBaseWillBeGarbageCollectedFinalized<Page
>, public WillBeHeapSupplementable<Page>, public PageLifecycleNotifier, public S
ettingsDelegate, public MemoryPurgeClient { | 73 class CORE_EXPORT Page final : public NoBaseWillBeGarbageCollectedFinalized<Page
>, public WillBeHeapSupplementable<Page>, public PageLifecycleNotifier, public S
ettingsDelegate, public MemoryPurgeClient { |
| 74 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Page); | 74 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Page); |
| 75 USING_FAST_MALLOC_WILL_BE_REMOVED(Page); | 75 USING_FAST_MALLOC_WILL_BE_REMOVED(Page); |
| 76 WTF_MAKE_NONCOPYABLE(Page); | 76 WTF_MAKE_NONCOPYABLE(Page); |
| 77 friend class Settings; | 77 friend class Settings; |
| 78 public: | 78 public: |
| 79 static void platformColorsChanged(); | |
| 80 static void onMemoryPressure(); | |
| 81 | |
| 82 // It is up to the platform to ensure that non-null clients are provided whe
re required. | 79 // It is up to the platform to ensure that non-null clients are provided whe
re required. |
| 83 struct CORE_EXPORT PageClients final { | 80 struct CORE_EXPORT PageClients final { |
| 84 STACK_ALLOCATED(); | 81 STACK_ALLOCATED(); |
| 85 WTF_MAKE_NONCOPYABLE(PageClients); | 82 WTF_MAKE_NONCOPYABLE(PageClients); |
| 86 public: | 83 public: |
| 87 PageClients(); | 84 PageClients(); |
| 88 ~PageClients(); | 85 ~PageClients(); |
| 89 | 86 |
| 90 RawPtrWillBeMember<ChromeClient> chromeClient; | 87 RawPtrWillBeMember<ChromeClient> chromeClient; |
| 91 ContextMenuClient* contextMenuClient; | 88 ContextMenuClient* contextMenuClient; |
| 92 EditorClient* editorClient; | 89 EditorClient* editorClient; |
| 93 DragClient* dragClient; | 90 DragClient* dragClient; |
| 94 SpellCheckerClient* spellCheckerClient; | 91 SpellCheckerClient* spellCheckerClient; |
| 95 }; | 92 }; |
| 96 | 93 |
| 97 explicit Page(PageClients&); | 94 static PassOwnPtrWillBeRawPtr<Page> create(PageClients& pageClients) |
| 95 { |
| 96 return adoptPtrWillBeNoop(new Page(pageClients)); |
| 97 } |
| 98 |
| 99 // An "ordinary" page is a fully-featured page owned by a web view. |
| 100 static PassOwnPtrWillBeRawPtr<Page> createOrdinary(PageClients&); |
| 101 |
| 98 ~Page() override; | 102 ~Page() override; |
| 99 | 103 |
| 100 void makeOrdinary(); | 104 void willBeClosed(); |
| 101 | 105 |
| 102 // This method returns all pages, incl. private ones associated with | 106 using PageSet = WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>; |
| 103 // inspector overlay, popups, SVGImage, etc. | 107 |
| 104 static WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& allPages()
; | 108 // Return the current set of full-fledged, ordinary pages. |
| 105 // This method returns all ordinary pages. | 109 // Each created and owned by a WebView. |
| 106 static WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& ordinaryPa
ges(); | 110 // |
| 111 // This set does not include Pages created for other, internal purposes |
| 112 // (SVGImages, inspector overlays, page popups etc.) |
| 113 static PageSet& ordinaryPages(); |
| 114 |
| 115 static void platformColorsChanged(); |
| 116 static void onMemoryPressure(); |
| 107 | 117 |
| 108 FrameHost& frameHost() const { return *m_frameHost; } | 118 FrameHost& frameHost() const { return *m_frameHost; } |
| 109 | 119 |
| 110 void setNeedsRecalcStyleInAllFrames(); | 120 void setNeedsRecalcStyleInAllFrames(); |
| 111 void updateAcceleratedCompositingSettings(); | 121 void updateAcceleratedCompositingSettings(); |
| 112 | 122 |
| 113 ViewportDescription viewportDescription() const; | 123 ViewportDescription viewportDescription() const; |
| 114 | 124 |
| 115 static void refreshPlugins(); | 125 static void refreshPlugins(); |
| 116 PluginData* pluginData() const; | 126 PluginData* pluginData() const; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 void purgeMemory(DeviceKind) override; | 218 void purgeMemory(DeviceKind) override; |
| 209 | 219 |
| 210 DECLARE_TRACE(); | 220 DECLARE_TRACE(); |
| 211 | 221 |
| 212 void layerTreeViewInitialized(WebLayerTreeView&); | 222 void layerTreeViewInitialized(WebLayerTreeView&); |
| 213 void willCloseLayerTreeView(WebLayerTreeView&); | 223 void willCloseLayerTreeView(WebLayerTreeView&); |
| 214 | 224 |
| 215 void willBeDestroyed(); | 225 void willBeDestroyed(); |
| 216 | 226 |
| 217 private: | 227 private: |
| 228 explicit Page(PageClients&); |
| 229 |
| 218 void initGroup(); | 230 void initGroup(); |
| 219 | 231 |
| 220 void setNeedsLayoutInAllFrames(); | 232 void setNeedsLayoutInAllFrames(); |
| 221 | 233 |
| 222 // SettingsDelegate overrides. | 234 // SettingsDelegate overrides. |
| 223 void settingsChanged(SettingsDelegate::ChangeType) override; | 235 void settingsChanged(SettingsDelegate::ChangeType) override; |
| 224 | 236 |
| 225 RefPtrWillBeMember<PageAnimator> m_animator; | 237 RefPtrWillBeMember<PageAnimator> m_animator; |
| 226 const OwnPtrWillBeMember<AutoscrollController> m_autoscrollController; | 238 const OwnPtrWillBeMember<AutoscrollController> m_autoscrollController; |
| 227 RawPtrWillBeMember<ChromeClient> m_chromeClient; | 239 RawPtrWillBeMember<ChromeClient> m_chromeClient; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 OwnPtrWillBeMember<FrameHost> m_frameHost; | 290 OwnPtrWillBeMember<FrameHost> m_frameHost; |
| 279 | 291 |
| 280 OwnPtrWillBeMember<MemoryPurgeController> m_memoryPurgeController; | 292 OwnPtrWillBeMember<MemoryPurgeController> m_memoryPurgeController; |
| 281 }; | 293 }; |
| 282 | 294 |
| 283 extern template class CORE_EXTERN_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; | 295 extern template class CORE_EXTERN_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; |
| 284 | 296 |
| 285 } // namespace blink | 297 } // namespace blink |
| 286 | 298 |
| 287 #endif // Page_h | 299 #endif // Page_h |
| OLD | NEW |