OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. |
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 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "core/page/ContextMenuController.h" | 43 #include "core/page/ContextMenuController.h" |
44 #include "core/page/DragController.h" | 44 #include "core/page/DragController.h" |
45 #include "core/page/FocusController.h" | 45 #include "core/page/FocusController.h" |
46 #include "core/page/PointerLockController.h" | 46 #include "core/page/PointerLockController.h" |
47 #include "core/page/ValidationMessageClient.h" | 47 #include "core/page/ValidationMessageClient.h" |
48 #include "core/page/scrolling/ScrollingCoordinator.h" | 48 #include "core/page/scrolling/ScrollingCoordinator.h" |
49 #include "core/paint/DeprecatedPaintLayer.h" | 49 #include "core/paint/DeprecatedPaintLayer.h" |
50 #include "platform/MemoryPurgeController.h" | 50 #include "platform/MemoryPurgeController.h" |
51 #include "platform/graphics/GraphicsLayer.h" | 51 #include "platform/graphics/GraphicsLayer.h" |
52 #include "platform/plugins/PluginData.h" | 52 #include "platform/plugins/PluginData.h" |
| 53 #include "public/platform/Platform.h" |
| 54 #include "public/platform/WebFrameHostScheduler.h" |
53 | 55 |
54 namespace blink { | 56 namespace blink { |
55 | 57 |
56 // static | 58 // static |
57 HashSet<Page*>& Page::allPages() | 59 HashSet<Page*>& Page::allPages() |
58 { | 60 { |
59 DEFINE_STATIC_LOCAL(HashSet<Page*>, allPages, ()); | 61 DEFINE_STATIC_LOCAL(HashSet<Page*>, allPages, ()); |
60 return allPages; | 62 return allPages; |
61 } | 63 } |
62 | 64 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 { | 382 { |
381 return m_timerAlignmentInterval; | 383 return m_timerAlignmentInterval; |
382 } | 384 } |
383 | 385 |
384 void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia
lState) | 386 void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia
lState) |
385 { | 387 { |
386 if (m_visibilityState == visibilityState) | 388 if (m_visibilityState == visibilityState) |
387 return; | 389 return; |
388 m_visibilityState = visibilityState; | 390 m_visibilityState = visibilityState; |
389 | 391 |
390 if (visibilityState == PageVisibilityStateVisible) | 392 // TODO(alexclarke): Move throttling of timers to chromium. |
| 393 if (visibilityState == PageVisibilityStateVisible) { |
| 394 m_frameHost->frameHostScheduler()->setPageInBackground(false); |
391 setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()); | 395 setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval()); |
392 else | 396 } else { |
| 397 m_frameHost->frameHostScheduler()->setPageInBackground(true); |
393 setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval()); | 398 setTimerAlignmentInterval(DOMTimer::hiddenPageAlignmentInterval()); |
| 399 } |
394 | 400 |
395 if (!isInitialState) | 401 if (!isInitialState) |
396 notifyPageVisibilityChanged(); | 402 notifyPageVisibilityChanged(); |
397 | 403 |
398 if (!isInitialState && m_mainFrame && m_mainFrame->isLocalFrame()) | 404 if (!isInitialState && m_mainFrame && m_mainFrame->isLocalFrame()) |
399 deprecatedLocalMainFrame()->didChangeVisibilityState(); | 405 deprecatedLocalMainFrame()->didChangeVisibilityState(); |
400 } | 406 } |
401 | 407 |
402 PageVisibilityState Page::visibilityState() const | 408 PageVisibilityState Page::visibilityState() const |
403 { | 409 { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 { | 608 { |
603 } | 609 } |
604 | 610 |
605 Page::PageClients::~PageClients() | 611 Page::PageClients::~PageClients() |
606 { | 612 { |
607 } | 613 } |
608 | 614 |
609 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; | 615 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; |
610 | 616 |
611 } // namespace blink | 617 } // namespace blink |
OLD | NEW |