Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: Source/core/page/Page.h

Issue 18777003: Extract simpler classes for observing context lifecycle and observe Page lifecycle inNavigatorVibra… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined~ Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.cpp ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 */ 19 */
20 20
21 #ifndef Page_h 21 #ifndef Page_h
22 #define Page_h 22 #define Page_h
23 23
24 #include "core/dom/ViewportArguments.h" 24 #include "core/dom/ViewportArguments.h"
25 #include "core/page/LayoutMilestones.h" 25 #include "core/page/LayoutMilestones.h"
26 #include "core/page/PageVisibilityState.h" 26 #include "core/page/PageVisibilityState.h"
27 #include "core/page/UseCounter.h" 27 #include "core/page/UseCounter.h"
28 #include "core/platform/LifecycleContext.h"
28 #include "core/platform/Supplementable.h" 29 #include "core/platform/Supplementable.h"
29 #include "core/platform/graphics/LayoutRect.h" 30 #include "core/platform/graphics/LayoutRect.h"
30 #include "core/platform/graphics/Region.h" 31 #include "core/platform/graphics/Region.h"
31 #include "core/rendering/Pagination.h" 32 #include "core/rendering/Pagination.h"
32 #include "wtf/Forward.h" 33 #include "wtf/Forward.h"
33 #include "wtf/HashSet.h" 34 #include "wtf/HashSet.h"
34 #include "wtf/Noncopyable.h" 35 #include "wtf/Noncopyable.h"
35 #include "wtf/text/WTFString.h" 36 #include "wtf/text/WTFString.h"
36 37
37 #if OS(SOLARIS) 38 #if OS(SOLARIS)
(...skipping 18 matching lines...) Expand all
56 class FocusController; 57 class FocusController;
57 class Frame; 58 class Frame;
58 class FrameSelection; 59 class FrameSelection;
59 class HaltablePlugin; 60 class HaltablePlugin;
60 class HistoryItem; 61 class HistoryItem;
61 class InspectorClient; 62 class InspectorClient;
62 class InspectorController; 63 class InspectorController;
63 class Node; 64 class Node;
64 class PageConsole; 65 class PageConsole;
65 class PageGroup; 66 class PageGroup;
67 class PageLifecycleNotifier;
66 class PlatformMouseEvent; 68 class PlatformMouseEvent;
67 class PluginData; 69 class PluginData;
68 class PointerLockController; 70 class PointerLockController;
69 class ProgressTracker; 71 class ProgressTracker;
70 class Range; 72 class Range;
71 class RenderBox; 73 class RenderBox;
72 class RenderObject; 74 class RenderObject;
73 class RenderTheme; 75 class RenderTheme;
74 class VisibleSelection; 76 class VisibleSelection;
75 class ScrollableArea; 77 class ScrollableArea;
76 class ScrollingCoordinator; 78 class ScrollingCoordinator;
77 class Settings; 79 class Settings;
78 class StorageNamespace; 80 class StorageNamespace;
79 class ValidationMessageClient; 81 class ValidationMessageClient;
80 82
81 typedef uint64_t LinkHash; 83 typedef uint64_t LinkHash;
82 84
83 float deviceScaleFactor(Frame*); 85 float deviceScaleFactor(Frame*);
84 86
85 struct ArenaSize { 87 struct ArenaSize {
86 ArenaSize(size_t treeSize, size_t allocated) 88 ArenaSize(size_t treeSize, size_t allocated)
87 : treeSize(treeSize) 89 : treeSize(treeSize)
88 , allocated(allocated) 90 , allocated(allocated)
89 { 91 {
90 } 92 }
91 size_t treeSize; 93 size_t treeSize;
92 size_t allocated; 94 size_t allocated;
93 }; 95 };
94 96
95 class Page : public Supplementable<Page> { 97 class Page : public Supplementable<Page>, public LifecycleContext {
96 WTF_MAKE_NONCOPYABLE(Page); 98 WTF_MAKE_NONCOPYABLE(Page);
97 friend class Settings; 99 friend class Settings;
98 public: 100 public:
99 static void scheduleForcedStyleRecalcForAllPages(); 101 static void scheduleForcedStyleRecalcForAllPages();
100 102
101 // It is up to the platform to ensure that non-null clients are provided whe re required. 103 // It is up to the platform to ensure that non-null clients are provided whe re required.
102 struct PageClients { 104 struct PageClients {
103 WTF_MAKE_NONCOPYABLE(PageClients); WTF_MAKE_FAST_ALLOCATED; 105 WTF_MAKE_NONCOPYABLE(PageClients); WTF_MAKE_FAST_ALLOCATED;
104 public: 106 public:
105 PageClients(); 107 PageClients();
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 257
256 class MultisamplingChangedObserver { 258 class MultisamplingChangedObserver {
257 public: 259 public:
258 virtual void multisamplingChanged(bool) = 0; 260 virtual void multisamplingChanged(bool) = 0;
259 }; 261 };
260 262
261 void addMultisamplingChangedObserver(MultisamplingChangedObserver*); 263 void addMultisamplingChangedObserver(MultisamplingChangedObserver*);
262 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); 264 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*);
263 void multisamplingChanged(); 265 void multisamplingChanged();
264 266
267 protected:
268 PageLifecycleNotifier* lifecycleNotifier();
269
265 private: 270 private:
266 void initGroup(); 271 void initGroup();
267 272
268 #if ASSERT_DISABLED 273 #if ASSERT_DISABLED
269 void checkSubframeCountConsistency() const { } 274 void checkSubframeCountConsistency() const { }
270 #else 275 #else
271 void checkSubframeCountConsistency() const; 276 void checkSubframeCountConsistency() const;
272 #endif 277 #endif
273 278
274 void setTimerAlignmentInterval(double); 279 void setTimerAlignmentInterval(double);
275 280
281 virtual PassOwnPtr<LifecycleNotifier> createLifecycleNotifier() OVERRIDE;
282
276 OwnPtr<AutoscrollController> m_autoscrollController; 283 OwnPtr<AutoscrollController> m_autoscrollController;
277 OwnPtr<Chrome> m_chrome; 284 OwnPtr<Chrome> m_chrome;
278 OwnPtr<DragCaretController> m_dragCaretController; 285 OwnPtr<DragCaretController> m_dragCaretController;
279 286
280 OwnPtr<DragController> m_dragController; 287 OwnPtr<DragController> m_dragController;
281 OwnPtr<FocusController> m_focusController; 288 OwnPtr<FocusController> m_focusController;
282 OwnPtr<ContextMenuController> m_contextMenuController; 289 OwnPtr<ContextMenuController> m_contextMenuController;
283 OwnPtr<InspectorController> m_inspectorController; 290 OwnPtr<InspectorController> m_inspectorController;
284 OwnPtr<PointerLockController> m_pointerLockController; 291 OwnPtr<PointerLockController> m_pointerLockController;
285 RefPtr<ScrollingCoordinator> m_scrollingCoordinator; 292 RefPtr<ScrollingCoordinator> m_scrollingCoordinator;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 #endif 344 #endif
338 345
339 const OwnPtr<PageConsole> m_console; 346 const OwnPtr<PageConsole> m_console;
340 347
341 HashSet<MultisamplingChangedObserver*> m_multisamplingChangedObservers; 348 HashSet<MultisamplingChangedObserver*> m_multisamplingChangedObservers;
342 }; 349 };
343 350
344 } // namespace WebCore 351 } // namespace WebCore
345 352
346 #endif // Page_h 353 #endif // Page_h
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.cpp ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698