| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2009, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 CHECKING_EVENT = 0, | 73 CHECKING_EVENT = 0, |
| 74 ERROR_EVENT, | 74 ERROR_EVENT, |
| 75 NOUPDATE_EVENT, | 75 NOUPDATE_EVENT, |
| 76 DOWNLOADING_EVENT, | 76 DOWNLOADING_EVENT, |
| 77 PROGRESS_EVENT, | 77 PROGRESS_EVENT, |
| 78 UPDATEREADY_EVENT, | 78 UPDATEREADY_EVENT, |
| 79 CACHED_EVENT, | 79 CACHED_EVENT, |
| 80 OBSOLETE_EVENT // Must remain the last value, this is used to size
arrays. | 80 OBSOLETE_EVENT // Must remain the last value, this is used to size
arrays. |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 #if ENABLE(INSPECTOR) | |
| 84 struct CacheInfo { | 83 struct CacheInfo { |
| 85 CacheInfo(const KURL& manifest, double creationTime, double updateTi
me, long long size) | 84 CacheInfo(const KURL& manifest, double creationTime, double updateTi
me, long long size) |
| 86 : m_manifest(manifest) | 85 : m_manifest(manifest) |
| 87 , m_creationTime(creationTime) | 86 , m_creationTime(creationTime) |
| 88 , m_updateTime(updateTime) | 87 , m_updateTime(updateTime) |
| 89 , m_size(size) { } | 88 , m_size(size) { } |
| 90 KURL m_manifest; | 89 KURL m_manifest; |
| 91 double m_creationTime; | 90 double m_creationTime; |
| 92 double m_updateTime; | 91 double m_updateTime; |
| 93 long long m_size; | 92 long long m_size; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 105 KURL m_resource; | 104 KURL m_resource; |
| 106 bool m_isMaster; | 105 bool m_isMaster; |
| 107 bool m_isManifest; | 106 bool m_isManifest; |
| 108 bool m_isFallback; | 107 bool m_isFallback; |
| 109 bool m_isForeign; | 108 bool m_isForeign; |
| 110 bool m_isExplicit; | 109 bool m_isExplicit; |
| 111 long long m_size; | 110 long long m_size; |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 typedef Vector<ResourceInfo> ResourceInfoList; | 113 typedef Vector<ResourceInfo> ResourceInfoList; |
| 115 #endif | |
| 116 | 114 |
| 117 ApplicationCacheHost(DocumentLoader*); | 115 ApplicationCacheHost(DocumentLoader*); |
| 118 ~ApplicationCacheHost(); | 116 ~ApplicationCacheHost(); |
| 119 | 117 |
| 120 void selectCacheWithoutManifest(); | 118 void selectCacheWithoutManifest(); |
| 121 void selectCacheWithManifest(const KURL& manifestURL); | 119 void selectCacheWithManifest(const KURL& manifestURL); |
| 122 | 120 |
| 123 void maybeLoadMainResource(ResourceRequest&, SubstituteData&); | 121 void maybeLoadMainResource(ResourceRequest&, SubstituteData&); |
| 124 void maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&)
; | 122 void maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&)
; |
| 125 bool maybeLoadFallbackForMainResponse(const ResourceRequest&, const Reso
urceResponse&); | 123 bool maybeLoadFallbackForMainResponse(const ResourceRequest&, const Reso
urceResponse&); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 143 bool swapCache(); | 141 bool swapCache(); |
| 144 void abort(); | 142 void abort(); |
| 145 | 143 |
| 146 void setDOMApplicationCache(DOMApplicationCache*); | 144 void setDOMApplicationCache(DOMApplicationCache*); |
| 147 void notifyDOMApplicationCache(EventID, int progressTotal, int progressD
one); | 145 void notifyDOMApplicationCache(EventID, int progressTotal, int progressD
one); |
| 148 | 146 |
| 149 void stopLoadingInFrame(Frame*); | 147 void stopLoadingInFrame(Frame*); |
| 150 | 148 |
| 151 void stopDeferringEvents(); // Also raises the events that have been que
ued up. | 149 void stopDeferringEvents(); // Also raises the events that have been que
ued up. |
| 152 | 150 |
| 153 #if ENABLE(INSPECTOR) | |
| 154 void fillResourceList(ResourceInfoList*); | 151 void fillResourceList(ResourceInfoList*); |
| 155 CacheInfo applicationCacheInfo(); | 152 CacheInfo applicationCacheInfo(); |
| 156 #endif | |
| 157 | 153 |
| 158 #if !PLATFORM(CHROMIUM) | 154 #if !PLATFORM(CHROMIUM) |
| 159 bool shouldLoadResourceFromApplicationCache(const ResourceRequest&, Appl
icationCacheResource*&); | 155 bool shouldLoadResourceFromApplicationCache(const ResourceRequest&, Appl
icationCacheResource*&); |
| 160 bool getApplicationCacheFallbackResource(const ResourceRequest&, Applica
tionCacheResource*&, ApplicationCache* = 0); | 156 bool getApplicationCacheFallbackResource(const ResourceRequest&, Applica
tionCacheResource*&, ApplicationCache* = 0); |
| 161 #endif | 157 #endif |
| 162 | 158 |
| 163 private: | 159 private: |
| 164 bool isApplicationCacheEnabled(); | 160 bool isApplicationCacheEnabled(); |
| 165 DocumentLoader* documentLoader() const { return m_documentLoader; } | 161 DocumentLoader* documentLoader() const { return m_documentLoader; } |
| 166 | 162 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 ApplicationCacheGroup* m_candidateApplicationCacheGroup; | 197 ApplicationCacheGroup* m_candidateApplicationCacheGroup; |
| 202 | 198 |
| 203 // This is the application cache the main resource was loaded from (if a
ny). | 199 // This is the application cache the main resource was loaded from (if a
ny). |
| 204 RefPtr<ApplicationCache> m_mainResourceApplicationCache; | 200 RefPtr<ApplicationCache> m_mainResourceApplicationCache; |
| 205 #endif | 201 #endif |
| 206 }; | 202 }; |
| 207 | 203 |
| 208 } // namespace WebCore | 204 } // namespace WebCore |
| 209 | 205 |
| 210 #endif // ApplicationCacheHost_h | 206 #endif // ApplicationCacheHost_h |
| OLD | NEW |