Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h

Issue 2747203002: Make prepareRequest() a separate callback of FetchContext (Closed)
Patch Set: addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool m_isForeign; 117 bool m_isForeign;
118 bool m_isExplicit; 118 bool m_isExplicit;
119 long long m_size; 119 long long m_size;
120 }; 120 };
121 121
122 typedef Vector<ResourceInfo> ResourceInfoList; 122 typedef Vector<ResourceInfo> ResourceInfoList;
123 123
124 void selectCacheWithoutManifest(); 124 void selectCacheWithoutManifest();
125 void selectCacheWithManifest(const KURL& manifestURL); 125 void selectCacheWithManifest(const KURL& manifestURL);
126 126
127 void willStartLoadingMainResource(ResourceRequest&); 127 // Annotate request for ApplicationCache. This internally calls
128 // willStartLoadingMainResource if it's for frame resource or
129 // willStartLoadingResource for subresource requests.
130 void willStartLoading(ResourceRequest&);
131
128 void didReceiveResponseForMainResource(const ResourceResponse&); 132 void didReceiveResponseForMainResource(const ResourceResponse&);
129 void mainResourceDataReceived(const char* data, size_t length); 133 void mainResourceDataReceived(const char* data, size_t length);
130 void finishedLoadingMainResource(); 134 void finishedLoadingMainResource();
131 void failedLoadingMainResource(); 135 void failedLoadingMainResource();
132 136
133 void willStartLoadingResource(ResourceRequest&);
134
135 Status getStatus() const; 137 Status getStatus() const;
136 bool update(); 138 bool update();
137 bool swapCache(); 139 bool swapCache();
138 void abort(); 140 void abort();
139 141
140 void setApplicationCache(ApplicationCache*); 142 void setApplicationCache(ApplicationCache*);
141 void notifyApplicationCache(EventID, 143 void notifyApplicationCache(EventID,
142 int progressTotal, 144 int progressTotal,
143 int progressDone, 145 int progressDone,
144 WebApplicationCacheHost::ErrorReason, 146 WebApplicationCacheHost::ErrorReason,
145 const String& errorURL, 147 const String& errorURL,
146 int errorStatus, 148 int errorStatus,
147 const String& errorMessage); 149 const String& errorMessage);
148 150
149 void 151 void
150 stopDeferringEvents(); // Also raises the events that have been queued up. 152 stopDeferringEvents(); // Also raises the events that have been queued up.
151 153
152 void fillResourceList(ResourceInfoList*); 154 void fillResourceList(ResourceInfoList*);
153 CacheInfo applicationCacheInfo(); 155 CacheInfo applicationCacheInfo();
154 156
155 DECLARE_TRACE(); 157 DECLARE_TRACE();
156 158
157 private: 159 private:
158 explicit ApplicationCacheHost(DocumentLoader*); 160 explicit ApplicationCacheHost(DocumentLoader*);
159 161
162 void willStartLoadingMainResource(ResourceRequest&);
163 void willStartLoadingResource(ResourceRequest&);
164
160 // WebApplicationCacheHostClient implementation 165 // WebApplicationCacheHostClient implementation
161 void didChangeCacheAssociation() final; 166 void didChangeCacheAssociation() final;
162 void notifyEventListener(WebApplicationCacheHost::EventID) final; 167 void notifyEventListener(WebApplicationCacheHost::EventID) final;
163 void notifyProgressEventListener(const WebURL&, 168 void notifyProgressEventListener(const WebURL&,
164 int progressTotal, 169 int progressTotal,
165 int progressDone) final; 170 int progressDone) final;
166 void notifyErrorEventListener(WebApplicationCacheHost::ErrorReason, 171 void notifyErrorEventListener(WebApplicationCacheHost::ErrorReason,
167 const WebURL&, 172 const WebURL&,
168 int status, 173 int status,
169 const WebString& message) final; 174 const WebString& message) final;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 const String& errorURL, 212 const String& errorURL,
208 int errorStatus, 213 int errorStatus,
209 const String& errorMessage); 214 const String& errorMessage);
210 215
211 std::unique_ptr<WebApplicationCacheHost> m_host; 216 std::unique_ptr<WebApplicationCacheHost> m_host;
212 }; 217 };
213 218
214 } // namespace blink 219 } // namespace blink
215 220
216 #endif // ApplicationCacheHost_h 221 #endif // ApplicationCacheHost_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698