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

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

Issue 2575923002: Make sure pages that are closing but not yet closed are still suspended (non-preferred approach). (Closed)
Patch Set: . Created 4 years 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 | « no previous file | third_party/WebKit/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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 class ContextMenuController; 53 class ContextMenuController;
54 class Document; 54 class Document;
55 class DragCaretController; 55 class DragCaretController;
56 class DragController; 56 class DragController;
57 class EditorClient; 57 class EditorClient;
58 class FocusController; 58 class FocusController;
59 class Frame; 59 class Frame;
60 class FrameHost; 60 class FrameHost;
61 class PluginData; 61 class PluginData;
62 class PointerLockController; 62 class PointerLockController;
63 class ScopedPageSuspender;
63 class ScrollingCoordinator; 64 class ScrollingCoordinator;
64 class Settings; 65 class Settings;
65 class SpellCheckerClient; 66 class SpellCheckerClient;
66 class ValidationMessageClient; 67 class ValidationMessageClient;
67 class WebLayerTreeView; 68 class WebLayerTreeView;
68 69
69 typedef uint64_t LinkHash; 70 typedef uint64_t LinkHash;
70 71
71 float deviceScaleFactor(LocalFrame*); 72 float deviceScaleFactor(LocalFrame*);
72 73
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 Deprecation& deprecation() { return m_deprecation; } 181 Deprecation& deprecation() { return m_deprecation; }
181 HostsUsingFeatures& hostsUsingFeatures() { return m_hostsUsingFeatures; } 182 HostsUsingFeatures& hostsUsingFeatures() { return m_hostsUsingFeatures; }
182 183
183 void setTabKeyCyclesThroughElements(bool b) { 184 void setTabKeyCyclesThroughElements(bool b) {
184 m_tabKeyCyclesThroughElements = b; 185 m_tabKeyCyclesThroughElements = b;
185 } 186 }
186 bool tabKeyCyclesThroughElements() const { 187 bool tabKeyCyclesThroughElements() const {
187 return m_tabKeyCyclesThroughElements; 188 return m_tabKeyCyclesThroughElements;
188 } 189 }
189 190
190 // DefersLoading is used to delay loads during modal dialogs. 191 // Suspension is used to implement the "Optionally, pause while waiting for
191 // Modal dialogs are supposed to freeze all background processes 192 // the user to acknowledge the message" step of simple dialog processing:
192 // in the page, including prevent additional loads from staring/continuing. 193 // https://html.spec.whatwg.org/multipage/webappapis.html#simple-dialogs
193 void setSuspended(bool); 194 //
195 // Per https://html.spec.whatwg.org/multipage/webappapis.html#pause, no loads
196 // are allowed to start/continue in this state, and all background processing
197 // is also suspended.
194 bool suspended() const { return m_suspended; } 198 bool suspended() const { return m_suspended; }
195 199
196 void setPageScaleFactor(float); 200 void setPageScaleFactor(float);
197 float pageScaleFactor() const; 201 float pageScaleFactor() const;
198 202
199 float deviceScaleFactor() const { return m_deviceScaleFactor; } 203 float deviceScaleFactor() const { return m_deviceScaleFactor; }
200 void setDeviceScaleFactor(float); 204 void setDeviceScaleFactor(float);
201 205
202 static void allVisitedStateChanged(bool invalidateVisitedLinkHashes); 206 static void allVisitedStateChanged(bool invalidateVisitedLinkHashes);
203 static void visitedStateChanged(LinkHash visitedHash); 207 static void visitedStateChanged(LinkHash visitedHash);
(...skipping 17 matching lines...) Expand all
221 static void networkStateChanged(bool online); 225 static void networkStateChanged(bool online);
222 226
223 DECLARE_TRACE(); 227 DECLARE_TRACE();
224 228
225 void layerTreeViewInitialized(WebLayerTreeView&); 229 void layerTreeViewInitialized(WebLayerTreeView&);
226 void willCloseLayerTreeView(WebLayerTreeView&); 230 void willCloseLayerTreeView(WebLayerTreeView&);
227 231
228 void willBeDestroyed(); 232 void willBeDestroyed();
229 233
230 private: 234 private:
235 friend class ScopedPageSuspender;
236
231 explicit Page(PageClients&); 237 explicit Page(PageClients&);
232 238
233 void initGroup(); 239 void initGroup();
234 240
235 // SettingsDelegate overrides. 241 // SettingsDelegate overrides.
236 void settingsChanged(SettingsDelegate::ChangeType) override; 242 void settingsChanged(SettingsDelegate::ChangeType) override;
237 243
244 // ScopedPageSuspender helpers.
245 void setSuspended(bool);
246 static PageSet& willBeClosedOrdinaryPages();
247
238 Member<PageAnimator> m_animator; 248 Member<PageAnimator> m_animator;
239 const Member<AutoscrollController> m_autoscrollController; 249 const Member<AutoscrollController> m_autoscrollController;
240 Member<ChromeClient> m_chromeClient; 250 Member<ChromeClient> m_chromeClient;
241 const Member<DragCaretController> m_dragCaretController; 251 const Member<DragCaretController> m_dragCaretController;
242 const Member<DragController> m_dragController; 252 const Member<DragController> m_dragController;
243 const Member<FocusController> m_focusController; 253 const Member<FocusController> m_focusController;
244 const Member<ContextMenuController> m_contextMenuController; 254 const Member<ContextMenuController> m_contextMenuController;
245 const Member<PointerLockController> m_pointerLockController; 255 const Member<PointerLockController> m_pointerLockController;
246 Member<ScrollingCoordinator> m_scrollingCoordinator; 256 Member<ScrollingCoordinator> m_scrollingCoordinator;
247 257
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // Page. 298 // Page.
289 // FIXME: Most of the members of Page should move onto FrameHost. 299 // FIXME: Most of the members of Page should move onto FrameHost.
290 Member<FrameHost> m_frameHost; 300 Member<FrameHost> m_frameHost;
291 }; 301 };
292 302
293 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Page>; 303 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Page>;
294 304
295 } // namespace blink 305 } // namespace blink
296 306
297 #endif // Page_h 307 #endif // Page_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698