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

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: Ensure m_scriptExecutionContext is maintained and not just null. 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
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/LifecycleContext.h"
24 #include "core/dom/ViewportArguments.h" 25 #include "core/dom/ViewportArguments.h"
25 #include "core/page/LayoutMilestones.h" 26 #include "core/page/LayoutMilestones.h"
26 #include "core/page/PageVisibilityState.h" 27 #include "core/page/PageVisibilityState.h"
27 #include "core/page/UseCounter.h" 28 #include "core/page/UseCounter.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"
(...skipping 22 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 263
262 class MultisamplingChangedObserver { 264 class MultisamplingChangedObserver {
263 public: 265 public:
264 virtual void multisamplingChanged(bool) = 0; 266 virtual void multisamplingChanged(bool) = 0;
265 }; 267 };
266 268
267 void addMultisamplingChangedObserver(MultisamplingChangedObserver*); 269 void addMultisamplingChangedObserver(MultisamplingChangedObserver*);
268 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*); 270 void removeMultisamplingChangedObserver(MultisamplingChangedObserver*);
269 void multisamplingChanged(); 271 void multisamplingChanged();
270 272
273 protected:
274 PageLifecycleNotifier* lifecycleNotifier();
275
271 private: 276 private:
272 void initGroup(); 277 void initGroup();
273 278
274 #if ASSERT_DISABLED 279 #if ASSERT_DISABLED
275 void checkSubframeCountConsistency() const { } 280 void checkSubframeCountConsistency() const { }
276 #else 281 #else
277 void checkSubframeCountConsistency() const; 282 void checkSubframeCountConsistency() const;
278 #endif 283 #endif
279 284
280 void setTimerAlignmentInterval(double); 285 void setTimerAlignmentInterval(double);
281 286
287 virtual PassOwnPtr<LifecycleNotifier> createLifecycleNotifier() OVERRIDE;
288
282 OwnPtr<AutoscrollController> m_autoscrollController; 289 OwnPtr<AutoscrollController> m_autoscrollController;
283 OwnPtr<Chrome> m_chrome; 290 OwnPtr<Chrome> m_chrome;
284 OwnPtr<DragCaretController> m_dragCaretController; 291 OwnPtr<DragCaretController> m_dragCaretController;
285 292
286 OwnPtr<DragController> m_dragController; 293 OwnPtr<DragController> m_dragController;
287 OwnPtr<FocusController> m_focusController; 294 OwnPtr<FocusController> m_focusController;
288 OwnPtr<ContextMenuController> m_contextMenuController; 295 OwnPtr<ContextMenuController> m_contextMenuController;
289 OwnPtr<InspectorController> m_inspectorController; 296 OwnPtr<InspectorController> m_inspectorController;
290 OwnPtr<PointerLockController> m_pointerLockController; 297 OwnPtr<PointerLockController> m_pointerLockController;
291 RefPtr<ScrollingCoordinator> m_scrollingCoordinator; 298 RefPtr<ScrollingCoordinator> m_scrollingCoordinator;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 #endif 352 #endif
346 353
347 const OwnPtr<PageConsole> m_console; 354 const OwnPtr<PageConsole> m_console;
348 355
349 HashSet<MultisamplingChangedObserver*> m_multisamplingChangedObservers; 356 HashSet<MultisamplingChangedObserver*> m_multisamplingChangedObservers;
350 }; 357 };
351 358
352 } // namespace WebCore 359 } // namespace WebCore
353 360
354 #endif // Page_h 361 #endif // Page_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698