| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 7 rights reserved. | 7 rights reserved. |
| 8 | 8 |
| 9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
| 10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 ResourceCallback::callbackHandler().cancel(this); | 835 ResourceCallback::callbackHandler().cancel(this); |
| 836 | 836 |
| 837 // Prevent the case when there are clients waiting but no callback scheduled. | 837 // Prevent the case when there are clients waiting but no callback scheduled. |
| 838 DCHECK(m_clientsAwaitingCallback.isEmpty() || scheduled); | 838 DCHECK(m_clientsAwaitingCallback.isEmpty() || scheduled); |
| 839 } | 839 } |
| 840 | 840 |
| 841 void Resource::prune() { | 841 void Resource::prune() { |
| 842 destroyDecodedDataIfPossible(); | 842 destroyDecodedDataIfPossible(); |
| 843 } | 843 } |
| 844 | 844 |
| 845 void Resource::onMemoryStateChange(MemoryState state) { | 845 void Resource::onPurgeMemory() { |
| 846 if (state != MemoryState::SUSPENDED) | |
| 847 return; | |
| 848 prune(); | 846 prune(); |
| 849 if (!m_cacheHandler) | 847 if (!m_cacheHandler) |
| 850 return; | 848 return; |
| 851 m_cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); | 849 m_cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); |
| 852 } | 850 } |
| 853 | 851 |
| 854 void Resource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, | 852 void Resource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, |
| 855 WebProcessMemoryDump* memoryDump) const { | 853 WebProcessMemoryDump* memoryDump) const { |
| 856 static const size_t kMaxURLReportLength = 128; | 854 static const size_t kMaxURLReportLength = 128; |
| 857 static const int kMaxResourceClientToShowInMemoryInfra = 10; | 855 static const int kMaxResourceClientToShowInMemoryInfra = 10; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 case Resource::Media: | 1107 case Resource::Media: |
| 1110 case Resource::Manifest: | 1108 case Resource::Manifest: |
| 1111 case Resource::Mock: | 1109 case Resource::Mock: |
| 1112 return false; | 1110 return false; |
| 1113 } | 1111 } |
| 1114 NOTREACHED(); | 1112 NOTREACHED(); |
| 1115 return false; | 1113 return false; |
| 1116 } | 1114 } |
| 1117 | 1115 |
| 1118 } // namespace blink | 1116 } // namespace blink |
| OLD | NEW |