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) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 | 6 |
7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (!originalURL.protocolIsInHTTPFamily()) | 102 if (!originalURL.protocolIsInHTTPFamily()) |
103 return originalURL; | 103 return originalURL; |
104 KURL url = originalURL; | 104 KURL url = originalURL; |
105 url.removeFragmentIdentifier(); | 105 url.removeFragmentIdentifier(); |
106 return url; | 106 return url; |
107 } | 107 } |
108 | 108 |
109 void MemoryCache::add(Resource* resource) | 109 void MemoryCache::add(Resource* resource) |
110 { | 110 { |
111 ASSERT(WTF::isMainThread()); | 111 ASSERT(WTF::isMainThread()); |
| 112 ASSERT(resource->url().isValid()); |
112 RELEASE_ASSERT(!m_resources.contains(resource->url())); | 113 RELEASE_ASSERT(!m_resources.contains(resource->url())); |
113 m_resources.set(resource->url(), MemoryCacheEntry::create(resource)); | 114 m_resources.set(resource->url().string(), MemoryCacheEntry::create(resource)
); |
114 update(resource, 0, resource->size(), true); | 115 update(resource, 0, resource->size(), true); |
115 | 116 |
116 WTF_LOG(ResourceLoading, "MemoryCache::add Added '%s', resource %p\n", resou
rce->url().string().latin1().data(), resource); | 117 WTF_LOG(ResourceLoading, "MemoryCache::add Added '%s', resource %p\n", resou
rce->url().string().latin1().data(), resource); |
117 } | 118 } |
118 | 119 |
119 void MemoryCache::replace(Resource* newResource, Resource* oldResource) | 120 void MemoryCache::replace(Resource* newResource, Resource* oldResource) |
120 { | 121 { |
121 if (MemoryCacheEntry* oldEntry = m_resources.get(oldResource->url())) | 122 if (MemoryCacheEntry* oldEntry = m_resources.get(oldResource->url())) |
122 evict(oldEntry); | 123 evict(oldEntry); |
123 add(newResource); | 124 add(newResource); |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz
e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur
rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was
Purged()); | 720 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz
e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur
rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was
Purged()); |
720 | 721 |
721 current = prev; | 722 current = prev; |
722 } | 723 } |
723 } | 724 } |
724 } | 725 } |
725 | 726 |
726 #endif // MEMORY_CACHE_STATS | 727 #endif // MEMORY_CACHE_STATS |
727 | 728 |
728 } // namespace WebCore | 729 } // namespace WebCore |
OLD | NEW |