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

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

Issue 2527143002: Suspend frame schedulers on a page suspension (Closed)
Patch Set: mod a comment 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All
3 * Rights Reserved. 3 * Rights 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/page/DragController.h" 49 #include "core/page/DragController.h"
50 #include "core/page/FocusController.h" 50 #include "core/page/FocusController.h"
51 #include "core/page/PointerLockController.h" 51 #include "core/page/PointerLockController.h"
52 #include "core/page/ScopedPageSuspender.h" 52 #include "core/page/ScopedPageSuspender.h"
53 #include "core/page/ValidationMessageClient.h" 53 #include "core/page/ValidationMessageClient.h"
54 #include "core/page/scrolling/ScrollingCoordinator.h" 54 #include "core/page/scrolling/ScrollingCoordinator.h"
55 #include "core/paint/PaintLayer.h" 55 #include "core/paint/PaintLayer.h"
56 #include "platform/graphics/GraphicsLayer.h" 56 #include "platform/graphics/GraphicsLayer.h"
57 #include "platform/plugins/PluginData.h" 57 #include "platform/plugins/PluginData.h"
58 #include "public/platform/Platform.h" 58 #include "public/platform/Platform.h"
59 #include "public/platform/WebFrameScheduler.h"
59 60
60 namespace blink { 61 namespace blink {
61 62
62 // Set of all live pages; includes internal Page objects that are 63 // Set of all live pages; includes internal Page objects that are
63 // not observable from scripts. 64 // not observable from scripts.
64 static Page::PageSet& allPages() { 65 static Page::PageSet& allPages() {
65 DEFINE_STATIC_LOCAL(Page::PageSet, allPages, ()); 66 DEFINE_STATIC_LOCAL(Page::PageSet, allPages, ());
66 return allPages; 67 return allPages;
67 } 68 }
68 69
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 if (!m_pluginData || 247 if (!m_pluginData ||
247 !mainFrameOrigin->isSameSchemeHostPort(m_pluginData->origin())) 248 !mainFrameOrigin->isSameSchemeHostPort(m_pluginData->origin()))
248 m_pluginData = PluginData::create(mainFrameOrigin); 249 m_pluginData = PluginData::create(mainFrameOrigin);
249 return m_pluginData.get(); 250 return m_pluginData.get();
250 } 251 }
251 252
252 void Page::setValidationMessageClient(ValidationMessageClient* client) { 253 void Page::setValidationMessageClient(ValidationMessageClient* client) {
253 m_validationMessageClient = client; 254 m_validationMessageClient = client;
254 } 255 }
255 256
256 void Page::setSuspended(bool suspend) { 257 void Page::setSuspended(bool suspended) {
257 if (suspend == m_suspended) 258 if (suspended == m_suspended)
258 return; 259 return;
259 260
260 m_suspended = suspend; 261 m_suspended = suspended;
261 for (Frame* frame = mainFrame(); frame; 262 for (Frame* frame = mainFrame(); frame;
262 frame = frame->tree().traverseNext()) { 263 frame = frame->tree().traverseNext()) {
263 if (frame->isLocalFrame()) 264 if (!frame->isLocalFrame())
264 toLocalFrame(frame)->loader().setDefersLoading(suspend); 265 continue;
266 LocalFrame* localFrame = toLocalFrame(frame);
267 localFrame->loader().setDefersLoading(suspended);
268 localFrame->frameScheduler()->setSuspended(suspended);
265 } 269 }
266 } 270 }
267 271
268 void Page::setPageScaleFactor(float scale) { 272 void Page::setPageScaleFactor(float scale) {
269 frameHost().visualViewport().setScale(scale); 273 frameHost().visualViewport().setScale(scale);
270 } 274 }
271 275
272 float Page::pageScaleFactor() const { 276 float Page::pageScaleFactor() const {
273 return frameHost().visualViewport().scale(); 277 return frameHost().visualViewport().scale();
274 } 278 }
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 : chromeClient(nullptr), 539 : chromeClient(nullptr),
536 contextMenuClient(nullptr), 540 contextMenuClient(nullptr),
537 editorClient(nullptr), 541 editorClient(nullptr),
538 spellCheckerClient(nullptr) {} 542 spellCheckerClient(nullptr) {}
539 543
540 Page::PageClients::~PageClients() {} 544 Page::PageClients::~PageClients() {}
541 545
542 template class CORE_TEMPLATE_EXPORT Supplement<Page>; 546 template class CORE_TEMPLATE_EXPORT Supplement<Page>;
543 547
544 } // namespace blink 548 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698