| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 { | 125 { |
| 126 if (!swapCache()) | 126 if (!swapCache()) |
| 127 ec = INVALID_STATE_ERR; | 127 ec = INVALID_STATE_ERR; |
| 128 } | 128 } |
| 129 | 129 |
| 130 PassRefPtr<DOMStringList> DOMApplicationCache::items() | 130 PassRefPtr<DOMStringList> DOMApplicationCache::items() |
| 131 { | 131 { |
| 132 Vector<String> result; | 132 Vector<String> result; |
| 133 if (ApplicationCache* cache = associatedCache()) { | 133 if (ApplicationCache* cache = associatedCache()) { |
| 134 unsigned numEntries = cache->numDynamicEntries(); | 134 unsigned numEntries = cache->numDynamicEntries(); |
| 135 result.reserveCapacity(numEntries); | 135 result.reserveInitialCapacity(numEntries); |
| 136 for (unsigned i = 0; i < numEntries; ++i) | 136 for (unsigned i = 0; i < numEntries; ++i) |
| 137 result.append(cache->dynamicEntry(i)); | 137 result.append(cache->dynamicEntry(i)); |
| 138 } | 138 } |
| 139 return StaticStringList::adopt(result); | 139 return StaticStringList::adopt(result); |
| 140 } | 140 } |
| 141 | 141 |
| 142 bool DOMApplicationCache::hasItem(const KURL& url, ExceptionCode& ec) | 142 bool DOMApplicationCache::hasItem(const KURL& url, ExceptionCode& ec) |
| 143 { | 143 { |
| 144 ApplicationCache* cache = associatedCache(); | 144 ApplicationCache* cache = associatedCache(); |
| 145 if (!cache) { | 145 if (!cache) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 294 } |
| 295 | 295 |
| 296 void DOMApplicationCache::callObsoleteListener() | 296 void DOMApplicationCache::callObsoleteListener() |
| 297 { | 297 { |
| 298 callListener(eventNames().obsoleteEvent, m_onObsoleteListener.get()); | 298 callListener(eventNames().obsoleteEvent, m_onObsoleteListener.get()); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace WebCore | 301 } // namespace WebCore |
| 302 | 302 |
| 303 #endif // ENABLE(OFFLINE_WEB_APPLICATIONS) | 303 #endif // ENABLE(OFFLINE_WEB_APPLICATIONS) |
| OLD | NEW |