Chromium Code Reviews| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 #include "core/page/ChromeClient.h" | 44 #include "core/page/ChromeClient.h" |
| 45 #include "core/page/ContextMenuController.h" | 45 #include "core/page/ContextMenuController.h" |
| 46 #include "core/page/DragController.h" | 46 #include "core/page/DragController.h" |
| 47 #include "core/page/FocusController.h" | 47 #include "core/page/FocusController.h" |
| 48 #include "core/page/PointerLockController.h" | 48 #include "core/page/PointerLockController.h" |
| 49 #include "core/page/ValidationMessageClient.h" | 49 #include "core/page/ValidationMessageClient.h" |
| 50 #include "core/page/scrolling/ScrollingCoordinator.h" | 50 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 51 #include "core/paint/PaintLayer.h" | 51 #include "core/paint/PaintLayer.h" |
| 52 #include "platform/graphics/GraphicsLayer.h" | 52 #include "platform/graphics/GraphicsLayer.h" |
| 53 #include "platform/plugins/PluginData.h" | 53 #include "platform/plugins/PluginData.h" |
| 54 #include "platform/text/CompressibleString.h" | |
| 54 #include "public/platform/Platform.h" | 55 #include "public/platform/Platform.h" |
| 55 | 56 |
| 56 namespace blink { | 57 namespace blink { |
| 57 | 58 |
| 58 // static | 59 // static |
| 59 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& Page::allPages() | 60 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& Page::allPages() |
| 60 { | 61 { |
| 61 DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page> >, allPages, ()); | 62 DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page> >, allPages, ()); |
| 62 return allPages; | 63 return allPages; |
| 63 } | 64 } |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 frames.append(toLocalFrame(frame)); | 534 frames.append(toLocalFrame(frame)); |
| 534 } | 535 } |
| 535 | 536 |
| 536 for (unsigned i = 0; i < frames.size(); ++i) | 537 for (unsigned i = 0; i < frames.size(); ++i) |
| 537 frames[i]->localDOMWindow()->acceptLanguagesChanged(); | 538 frames[i]->localDOMWindow()->acceptLanguagesChanged(); |
| 538 } | 539 } |
| 539 | 540 |
| 540 void Page::purgeMemory(MemoryPurgeMode mode, DeviceKind deviceKind) | 541 void Page::purgeMemory(MemoryPurgeMode mode, DeviceKind deviceKind) |
| 541 { | 542 { |
| 542 Frame* frame = mainFrame(); | 543 Frame* frame = mainFrame(); |
| 543 if (deviceKind != DeviceKind::LowEnd || !frame || !frame->isLocalFrame()) | 544 if (deviceKind == DeviceKind::LowEnd && frame && frame->isLocalFrame()) { |
| 544 return; | 545 if (mode == MemoryPurgeMode::InactiveTab) { |
| 545 if (mode == MemoryPurgeMode::InactiveTab) { | 546 if (Document* document = toLocalFrame(frame)->document()) |
| 546 if (Document* document = toLocalFrame(frame)->document()) | 547 document->fetcher()->garbageCollectDocumentResources(); |
| 547 document->fetcher()->garbageCollectDocumentResources(); | 548 memoryCache()->pruneAll(); |
| 548 memoryCache()->pruneAll(); | 549 } |
| 549 } | 550 } |
| 551 | |
| 552 CompressibleStringImpl::purgeMemory(); | |
|
haraken
2015/11/26 11:50:03
I'd propose to introduce a separate method for doi
| |
| 550 } | 553 } |
| 551 | 554 |
| 552 DEFINE_TRACE(Page) | 555 DEFINE_TRACE(Page) |
| 553 { | 556 { |
| 554 #if ENABLE(OILPAN) | 557 #if ENABLE(OILPAN) |
| 555 visitor->trace(m_animator); | 558 visitor->trace(m_animator); |
| 556 visitor->trace(m_autoscrollController); | 559 visitor->trace(m_autoscrollController); |
| 557 visitor->trace(m_chromeClient); | 560 visitor->trace(m_chromeClient); |
| 558 visitor->trace(m_dragCaretController); | 561 visitor->trace(m_dragCaretController); |
| 559 visitor->trace(m_dragController); | 562 visitor->trace(m_dragController); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 { | 616 { |
| 614 } | 617 } |
| 615 | 618 |
| 616 Page::PageClients::~PageClients() | 619 Page::PageClients::~PageClients() |
| 617 { | 620 { |
| 618 } | 621 } |
| 619 | 622 |
| 620 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; | 623 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; |
| 621 | 624 |
| 622 } // namespace blink | 625 } // namespace blink |
| OLD | NEW |