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

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

Issue 1428383002: Make ResourceFetcher::m_documentResources use WeakPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODOs Created 5 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 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 if (frame->isLocalFrame()) 507 if (frame->isLocalFrame())
508 frames.append(toLocalFrame(frame)); 508 frames.append(toLocalFrame(frame));
509 } 509 }
510 510
511 for (unsigned i = 0; i < frames.size(); ++i) 511 for (unsigned i = 0; i < frames.size(); ++i)
512 frames[i]->localDOMWindow()->acceptLanguagesChanged(); 512 frames[i]->localDOMWindow()->acceptLanguagesChanged();
513 } 513 }
514 514
515 void Page::purgeMemory(DeviceKind deviceKind) 515 void Page::purgeMemory(DeviceKind deviceKind)
516 { 516 {
517 Frame* frame = mainFrame(); 517 if (deviceKind == DeviceKind::LowEnd)
518 if (deviceKind != DeviceKind::LowEnd || !frame || !frame->isLocalFrame()) 518 memoryCache()->pruneAll();
519 return;
520 if (Document* document = toLocalFrame(frame)->document())
521 document->fetcher()->garbageCollectDocumentResources();
522 memoryCache()->pruneAll();
523 } 519 }
524 520
525 DEFINE_TRACE(Page) 521 DEFINE_TRACE(Page)
526 { 522 {
527 #if ENABLE(OILPAN) 523 #if ENABLE(OILPAN)
528 visitor->trace(m_animator); 524 visitor->trace(m_animator);
529 visitor->trace(m_autoscrollController); 525 visitor->trace(m_autoscrollController);
530 visitor->trace(m_chromeClient); 526 visitor->trace(m_chromeClient);
531 visitor->trace(m_dragCaretController); 527 visitor->trace(m_dragCaretController);
532 visitor->trace(m_dragController); 528 visitor->trace(m_dragController);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 { 588 {
593 } 589 }
594 590
595 Page::PageClients::~PageClients() 591 Page::PageClients::~PageClients()
596 { 592 {
597 } 593 }
598 594
599 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; 595 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>;
600 596
601 } // namespace blink 597 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698