Chromium Code Reviews| 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 rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 414 // Currently, only one type of cached metadata per resource is supported. | 414 // Currently, only one type of cached metadata per resource is supported. |
| 415 // If the need arises for multiple types of metadata per resource this could | 415 // If the need arises for multiple types of metadata per resource this could |
| 416 // be enhanced to store types of metadata in a map. | 416 // be enhanced to store types of metadata in a map. |
| 417 ASSERT(!m_cachedMetadata); | 417 ASSERT(!m_cachedMetadata); |
| 418 | 418 |
| 419 m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size); | 419 m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size); |
| 420 const Vector<char>& serializedData = m_cachedMetadata->serialize(); | 420 const Vector<char>& serializedData = m_cachedMetadata->serialize(); |
| 421 blink::Platform::current()->cacheMetadata(m_response.url(), m_response.respo nseTime(), serializedData.data(), serializedData.size()); | 421 blink::Platform::current()->cacheMetadata(m_response.url(), m_response.respo nseTime(), serializedData.data(), serializedData.size()); |
| 422 } | 422 } |
| 423 | 423 |
| 424 void Resource::clearCachedMetadata() | |
| 425 { | |
| 426 m_cachedMetadata.clear(); | |
|
jochen (gone - plz use gerrit)
2014/08/04 09:27:29
have you verified that this works across reloads,
vogelheim
2014/08/05 16:03:36
Not yet. :) Will do before proceeding with the CL.
| |
| 427 } | |
| 428 | |
| 424 bool Resource::canDelete() const | 429 bool Resource::canDelete() const |
| 425 { | 430 { |
| 426 return !hasClients() && !m_loader && !m_preloadCount && hasRightHandleCountA partFromCache(0) | 431 return !hasClients() && !m_loader && !m_preloadCount && hasRightHandleCountA partFromCache(0) |
| 427 && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource; | 432 && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource; |
| 428 } | 433 } |
| 429 | 434 |
| 430 bool Resource::hasOneHandle() const | 435 bool Resource::hasOneHandle() const |
| 431 { | 436 { |
| 432 return hasRightHandleCountApartFromCache(1); | 437 return hasRightHandleCountApartFromCache(1); |
| 433 } | 438 } |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1005 return "ImportResource"; | 1010 return "ImportResource"; |
| 1006 case Resource::Media: | 1011 case Resource::Media: |
| 1007 return "Media"; | 1012 return "Media"; |
| 1008 } | 1013 } |
| 1009 ASSERT_NOT_REACHED(); | 1014 ASSERT_NOT_REACHED(); |
| 1010 return "Unknown"; | 1015 return "Unknown"; |
| 1011 } | 1016 } |
| 1012 #endif // !LOG_DISABLED | 1017 #endif // !LOG_DISABLED |
| 1013 | 1018 |
| 1014 } | 1019 } |
| OLD | NEW |