| 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 } | 614 } |
| 615 if (!hasClients()) | 615 if (!hasClients()) |
| 616 memoryCache()->makeLive(this); | 616 memoryCache()->makeLive(this); |
| 617 | 617 |
| 618 if (!m_revalidatingRequest.isNull()) { | 618 if (!m_revalidatingRequest.isNull()) { |
| 619 m_clients.add(client); | 619 m_clients.add(client); |
| 620 return; | 620 return; |
| 621 } | 621 } |
| 622 | 622 |
| 623 // If we have existing data to send to the new client and the resource type
supprts it, send it asynchronously. | 623 // If we have existing data to send to the new client and the resource type
supprts it, send it asynchronously. |
| 624 if (!m_response.isNull() && !shouldSendCachedDataSynchronouslyForType(type()
) && !m_needsSynchronousCacheHit) { | 624 if (!m_response.isNull() && !shouldSendCachedDataSynchronouslyForType(getTyp
e()) && !m_needsSynchronousCacheHit) { |
| 625 m_clientsAwaitingCallback.add(client); | 625 m_clientsAwaitingCallback.add(client); |
| 626 ResourceCallback::callbackHandler()->schedule(this); | 626 ResourceCallback::callbackHandler()->schedule(this); |
| 627 return; | 627 return; |
| 628 } | 628 } |
| 629 | 629 |
| 630 m_clients.add(client); | 630 m_clients.add(client); |
| 631 didAddClient(client); | 631 didAddClient(client); |
| 632 return; | 632 return; |
| 633 } | 633 } |
| 634 | 634 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 } | 807 } |
| 808 | 808 |
| 809 const String overheadName = dumpName + "/metadata"; | 809 const String overheadName = dumpName + "/metadata"; |
| 810 WebMemoryAllocatorDump* overheadDump = memoryDump->createMemoryAllocatorDump
(overheadName); | 810 WebMemoryAllocatorDump* overheadDump = memoryDump->createMemoryAllocatorDump
(overheadName); |
| 811 overheadDump->addScalar("size", "bytes", overheadSize()); | 811 overheadDump->addScalar("size", "bytes", overheadSize()); |
| 812 memoryDump->addSuballocation(overheadDump->guid(), String(WTF::Partitions::k
AllocatedObjectPoolName)); | 812 memoryDump->addSuballocation(overheadDump->guid(), String(WTF::Partitions::k
AllocatedObjectPoolName)); |
| 813 } | 813 } |
| 814 | 814 |
| 815 String Resource::getMemoryDumpName() const | 815 String Resource::getMemoryDumpName() const |
| 816 { | 816 { |
| 817 return String::format("web_cache/%s_resources/%ld", resourceTypeToString(typ
e(), options().initiatorInfo), m_identifier); | 817 return String::format("web_cache/%s_resources/%ld", resourceTypeToString(get
Type(), options().initiatorInfo), m_identifier); |
| 818 } | 818 } |
| 819 | 819 |
| 820 void Resource::revalidationSucceeded(const ResourceResponse& validatingResponse) | 820 void Resource::revalidationSucceeded(const ResourceResponse& validatingResponse) |
| 821 { | 821 { |
| 822 m_response.setResourceLoadTiming(validatingResponse.resourceLoadTiming()); | 822 m_response.setResourceLoadTiming(validatingResponse.resourceLoadTiming()); |
| 823 | 823 |
| 824 // RFC2616 10.3.5 | 824 // RFC2616 10.3.5 |
| 825 // Update cached headers from the 304 response | 825 // Update cached headers from the 304 response |
| 826 const HTTPHeaderMap& newHeaders = validatingResponse.httpHeaderFields(); | 826 const HTTPHeaderMap& newHeaders = validatingResponse.httpHeaderFields(); |
| 827 for (const auto& header : newHeaders) { | 827 for (const auto& header : newHeaders) { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 case Resource::Media: | 1117 case Resource::Media: |
| 1118 return "Media"; | 1118 return "Media"; |
| 1119 case Resource::Manifest: | 1119 case Resource::Manifest: |
| 1120 return "Manifest"; | 1120 return "Manifest"; |
| 1121 } | 1121 } |
| 1122 ASSERT_NOT_REACHED(); | 1122 ASSERT_NOT_REACHED(); |
| 1123 return "Unknown"; | 1123 return "Unknown"; |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 } // namespace blink | 1126 } // namespace blink |
| OLD | NEW |