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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 | 482 |
483 m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size); | 483 m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size); |
484 | 484 |
485 // We don't support sending the metadata to the platform when the response | 485 // We don't support sending the metadata to the platform when the response |
486 // was fetched via a ServiceWorker to prevent an attacker's Service Worker | 486 // was fetched via a ServiceWorker to prevent an attacker's Service Worker |
487 // from poisoning the metadata cache. | 487 // from poisoning the metadata cache. |
488 // FIXME: Support sending the metadata even if the response was fetched via | 488 // FIXME: Support sending the metadata even if the response was fetched via |
489 // a ServiceWorker. https://crbug.com/448706 | 489 // a ServiceWorker. https://crbug.com/448706 |
490 if (cacheType == CachedMetadataHandler::SendToPlatform && !m_response.wasFet
chedViaServiceWorker()) { | 490 if (cacheType == CachedMetadataHandler::SendToPlatform && !m_response.wasFet
chedViaServiceWorker()) { |
491 const Vector<char>& serializedData = m_cachedMetadata->serialize(); | 491 const Vector<char>& serializedData = m_cachedMetadata->serialize(); |
492 blink::Platform::current()->cacheMetadata(m_response.url(), m_response.r
esponseTime(), serializedData.data(), serializedData.size()); | 492 Platform::current()->cacheMetadata(m_response.url(), m_response.response
Time(), serializedData.data(), serializedData.size()); |
493 } | 493 } |
494 } | 494 } |
495 | 495 |
496 void Resource::clearCachedMetadata(CachedMetadataHandler::CacheType cacheType) | 496 void Resource::clearCachedMetadata(CachedMetadataHandler::CacheType cacheType) |
497 { | 497 { |
498 m_cachedMetadata.clear(); | 498 m_cachedMetadata.clear(); |
499 | 499 |
500 if (cacheType == CachedMetadataHandler::SendToPlatform) | 500 if (cacheType == CachedMetadataHandler::SendToPlatform) |
501 blink::Platform::current()->cacheMetadata(m_response.url(), m_response.r
esponseTime(), 0, 0); | 501 Platform::current()->cacheMetadata(m_response.url(), m_response.response
Time(), 0, 0); |
502 } | 502 } |
503 | 503 |
504 bool Resource::canDelete() const | 504 bool Resource::canDelete() const |
505 { | 505 { |
506 return !hasClients() && !m_loader && !m_preloadCount && hasRightHandleCountA
partFromCache(0) | 506 return !hasClients() && !m_loader && !m_preloadCount && hasRightHandleCountA
partFromCache(0) |
507 && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource; | 507 && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource; |
508 } | 508 } |
509 | 509 |
510 bool Resource::hasOneHandle() const | 510 bool Resource::hasOneHandle() const |
511 { | 511 { |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 case Resource::ImportResource: | 1074 case Resource::ImportResource: |
1075 return "ImportResource"; | 1075 return "ImportResource"; |
1076 case Resource::Media: | 1076 case Resource::Media: |
1077 return "Media"; | 1077 return "Media"; |
1078 } | 1078 } |
1079 ASSERT_NOT_REACHED(); | 1079 ASSERT_NOT_REACHED(); |
1080 return "Unknown"; | 1080 return "Unknown"; |
1081 } | 1081 } |
1082 #endif // !LOG_DISABLED | 1082 #endif // !LOG_DISABLED |
1083 | 1083 |
1084 } | 1084 } // namespace blink |
OLD | NEW |