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

Side by Side Diff: Source/platform/network/ResourceResponse.h

Issue 378473002: [ServiceWorker] Add wasFetchedViaServiceWorker flag to WebURLResponse and ResourceResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: s/responce/response/ Created 6 years, 5 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return m_wasAlternateProtocolAvailable; 152 return m_wasAlternateProtocolAvailable;
153 } 153 }
154 void setWasAlternateProtocolAvailable(bool value) 154 void setWasAlternateProtocolAvailable(bool value)
155 { 155 {
156 m_wasAlternateProtocolAvailable = value; 156 m_wasAlternateProtocolAvailable = value;
157 } 157 }
158 158
159 bool wasFetchedViaProxy() const { return m_wasFetchedViaProxy; } 159 bool wasFetchedViaProxy() const { return m_wasFetchedViaProxy; }
160 void setWasFetchedViaProxy(bool value) { m_wasFetchedViaProxy = value; } 160 void setWasFetchedViaProxy(bool value) { m_wasFetchedViaProxy = value; }
161 161
162 bool wasFetchedViaServiceWorker() const { return m_wasFetchedViaServiceWorke r; }
163 void setWasFetchedViaServiceWorker(bool value) { m_wasFetchedViaServiceWorke r = value; }
164
162 bool isMultipartPayload() const { return m_isMultipartPayload; } 165 bool isMultipartPayload() const { return m_isMultipartPayload; }
163 void setIsMultipartPayload(bool value) { m_isMultipartPayload = value; } 166 void setIsMultipartPayload(bool value) { m_isMultipartPayload = value; }
164 167
165 double responseTime() const { return m_responseTime; } 168 double responseTime() const { return m_responseTime; }
166 void setResponseTime(double responseTime) { m_responseTime = responseTime; } 169 void setResponseTime(double responseTime) { m_responseTime = responseTime; }
167 170
168 const AtomicString& remoteIPAddress() const { return m_remoteIPAddress; } 171 const AtomicString& remoteIPAddress() const { return m_remoteIPAddress; }
169 void setRemoteIPAddress(const AtomicString& value) { m_remoteIPAddress = val ue; } 172 void setRemoteIPAddress(const AtomicString& value) { m_remoteIPAddress = val ue; }
170 173
171 unsigned short remotePort() const { return m_remotePort; } 174 unsigned short remotePort() const { return m_remotePort; }
172 void setRemotePort(unsigned short value) { m_remotePort = value; } 175 void setRemotePort(unsigned short value) { m_remotePort = value; }
173 176
174 const String& downloadedFilePath() const { return m_downloadedFilePath; } 177 const String& downloadedFilePath() const { return m_downloadedFilePath; }
175 void setDownloadedFilePath(const String&); 178 void setDownloadedFilePath(const String&);
176 179
177 // Extra data associated with this response. 180 // Extra data associated with this response.
178 ExtraData* extraData() const { return m_extraData.get(); } 181 ExtraData* extraData() const { return m_extraData.get(); }
179 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; } 182 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; }
180 183
181 // The ResourceResponse subclass may "shadow" this method to provide platfor m-specific memory usage information 184 // The ResourceResponse subclass may "shadow" this method to provide platfor m-specific memory usage information
182 unsigned memoryUsage() const 185 unsigned memoryUsage() const
183 { 186 {
184 // average size, mostly due to URL and Header Map strings 187 // average size, mostly due to URL and Header Map strings
185 return 1280; 188 return 1280;
186 } 189 }
187 190
191 // This method doesn't compare the all members.
188 static bool compare(const ResourceResponse&, const ResourceResponse&); 192 static bool compare(const ResourceResponse&, const ResourceResponse&);
189 193
190 private: 194 private:
191 void updateHeaderParsedState(const AtomicString& name); 195 void updateHeaderParsedState(const AtomicString& name);
192 196
193 KURL m_url; 197 KURL m_url;
194 AtomicString m_mimeType; 198 AtomicString m_mimeType;
195 long long m_expectedContentLength; 199 long long m_expectedContentLength;
196 AtomicString m_textEncodingName; 200 AtomicString m_textEncodingName;
197 String m_suggestedFilename; 201 String m_suggestedFilename;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Was the resource fetched over a channel which used TLS/Next-Protocol-Nego tiation (also SPDY related). 248 // Was the resource fetched over a channel which used TLS/Next-Protocol-Nego tiation (also SPDY related).
245 bool m_wasNpnNegotiated; 249 bool m_wasNpnNegotiated;
246 250
247 // Was the resource fetched over a channel which specified "Alternate-Protoc ol" 251 // Was the resource fetched over a channel which specified "Alternate-Protoc ol"
248 // (e.g.: Alternate-Protocol: 443:npn-spdy/1). 252 // (e.g.: Alternate-Protocol: 443:npn-spdy/1).
249 bool m_wasAlternateProtocolAvailable; 253 bool m_wasAlternateProtocolAvailable;
250 254
251 // Was the resource fetched over an explicit proxy (HTTP, SOCKS, etc). 255 // Was the resource fetched over an explicit proxy (HTTP, SOCKS, etc).
252 bool m_wasFetchedViaProxy; 256 bool m_wasFetchedViaProxy;
253 257
258 // Was the resource fetched over a ServiceWorker.
259 bool m_wasFetchedViaServiceWorker;
260
254 // The time at which the response headers were received. For cached 261 // The time at which the response headers were received. For cached
255 // responses, this time could be "far" in the past. 262 // responses, this time could be "far" in the past.
256 double m_responseTime; 263 double m_responseTime;
257 264
258 // Remote IP address of the socket which fetched this resource. 265 // Remote IP address of the socket which fetched this resource.
259 AtomicString m_remoteIPAddress; 266 AtomicString m_remoteIPAddress;
260 267
261 // Remote port number of the socket which fetched this resource. 268 // Remote port number of the socket which fetched this resource.
262 unsigned short m_remotePort; 269 unsigned short m_remotePort;
263 270
(...skipping 27 matching lines...) Expand all
291 RefPtr<ResourceLoadTiming> m_resourceLoadTiming; 298 RefPtr<ResourceLoadTiming> m_resourceLoadTiming;
292 CString m_securityInfo; 299 CString m_securityInfo;
293 ResourceResponse::HTTPVersion m_httpVersion; 300 ResourceResponse::HTTPVersion m_httpVersion;
294 long long m_appCacheID; 301 long long m_appCacheID;
295 KURL m_appCacheManifestURL; 302 KURL m_appCacheManifestURL;
296 bool m_isMultipartPayload; 303 bool m_isMultipartPayload;
297 bool m_wasFetchedViaSPDY; 304 bool m_wasFetchedViaSPDY;
298 bool m_wasNpnNegotiated; 305 bool m_wasNpnNegotiated;
299 bool m_wasAlternateProtocolAvailable; 306 bool m_wasAlternateProtocolAvailable;
300 bool m_wasFetchedViaProxy; 307 bool m_wasFetchedViaProxy;
308 bool m_wasFetchedViaServiceWorker;
301 double m_responseTime; 309 double m_responseTime;
302 String m_remoteIPAddress; 310 String m_remoteIPAddress;
303 unsigned short m_remotePort; 311 unsigned short m_remotePort;
304 String m_downloadedFilePath; 312 String m_downloadedFilePath;
305 RefPtr<BlobDataHandle> m_downloadedFileHandle; 313 RefPtr<BlobDataHandle> m_downloadedFileHandle;
306 }; 314 };
307 315
308 } // namespace WebCore 316 } // namespace WebCore
309 317
310 #endif // ResourceResponse_h 318 #endif // ResourceResponse_h
OLDNEW
« no previous file with comments | « Source/platform/exported/WebURLResponse.cpp ('k') | Source/platform/network/ResourceResponse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698