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

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

Issue 2316573002: PlzNavigate: Support ResourceTiming API (Closed)
Patch Set: Nit + rebase + build fix Created 4 years, 3 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 int64_t responseTime() const { return m_responseTime; } 278 int64_t responseTime() const { return m_responseTime; }
279 void setResponseTime(int64_t responseTime) { m_responseTime = responseTime; } 279 void setResponseTime(int64_t responseTime) { m_responseTime = responseTime; }
280 280
281 const AtomicString& remoteIPAddress() const { return m_remoteIPAddress; } 281 const AtomicString& remoteIPAddress() const { return m_remoteIPAddress; }
282 void setRemoteIPAddress(const AtomicString& value) { m_remoteIPAddress = val ue; } 282 void setRemoteIPAddress(const AtomicString& value) { m_remoteIPAddress = val ue; }
283 283
284 unsigned short remotePort() const { return m_remotePort; } 284 unsigned short remotePort() const { return m_remotePort; }
285 void setRemotePort(unsigned short value) { m_remotePort = value; } 285 void setRemotePort(unsigned short value) { m_remotePort = value; }
286 286
287 long long encodedDataLength() const { return m_encodedDataLength; }
288 void addToEncodedDataLength(long long value);
289
287 long long encodedBodyLength() const { return m_encodedBodyLength; } 290 long long encodedBodyLength() const { return m_encodedBodyLength; }
288 void addToEncodedBodyLength(int value); 291 void addToEncodedBodyLength(long long value);
289 292
290 long long decodedBodyLength() const { return m_decodedBodyLength; } 293 long long decodedBodyLength() const { return m_decodedBodyLength; }
291 void addToDecodedBodyLength(int value); 294 void addToDecodedBodyLength(long long value);
292 295
293 const String& downloadedFilePath() const { return m_downloadedFilePath; } 296 const String& downloadedFilePath() const { return m_downloadedFilePath; }
294 void setDownloadedFilePath(const String&); 297 void setDownloadedFilePath(const String&);
295 298
296 // Extra data associated with this response. 299 // Extra data associated with this response.
297 ExtraData* getExtraData() const { return m_extraData.get(); } 300 ExtraData* getExtraData() const { return m_extraData.get(); }
298 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; } 301 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; }
299 302
300 unsigned memoryUsage() const 303 unsigned memoryUsage() const
301 { 304 {
302 // average size, mostly due to URL and Header Map strings 305 // average size, mostly due to URL and Header Map strings
303 return 1280; 306 return 1280;
304 } 307 }
305 308
309 // PlzNavigate: Even if there is redirections, only one
310 // ResourceResponse is built: the final response.
311 // The redirect response chain can be accessed by this function.
312 const Vector<ResourceResponse>& redirectResponses() const { return m_redirec tResponses; }
313 void appendRedirectResponse(const ResourceResponse&);
314
306 // This method doesn't compare the all members. 315 // This method doesn't compare the all members.
307 static bool compare(const ResourceResponse&, const ResourceResponse&); 316 static bool compare(const ResourceResponse&, const ResourceResponse&);
308 317
309 private: 318 private:
310 void updateHeaderParsedState(const AtomicString& name); 319 void updateHeaderParsedState(const AtomicString& name);
311 320
312 KURL m_url; 321 KURL m_url;
313 AtomicString m_mimeType; 322 AtomicString m_mimeType;
314 long long m_expectedContentLength; 323 long long m_expectedContentLength;
315 AtomicString m_textEncodingName; 324 AtomicString m_textEncodingName;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // The time at which the response headers were received. For cached 415 // The time at which the response headers were received. For cached
407 // responses, this time could be "far" in the past. 416 // responses, this time could be "far" in the past.
408 int64_t m_responseTime; 417 int64_t m_responseTime;
409 418
410 // Remote IP address of the socket which fetched this resource. 419 // Remote IP address of the socket which fetched this resource.
411 AtomicString m_remoteIPAddress; 420 AtomicString m_remoteIPAddress;
412 421
413 // Remote port number of the socket which fetched this resource. 422 // Remote port number of the socket which fetched this resource.
414 unsigned short m_remotePort; 423 unsigned short m_remotePort;
415 424
425 // Size of the response in bytes prior to decompression.
426 long long m_encodedDataLength;
427
416 // Size of the response body in bytes prior to decompression. 428 // Size of the response body in bytes prior to decompression.
417 long long m_encodedBodyLength; 429 long long m_encodedBodyLength;
418 430
419 // Sizes of the response body in bytes after any content-encoding is 431 // Sizes of the response body in bytes after any content-encoding is
420 // removed. 432 // removed.
421 long long m_decodedBodyLength; 433 long long m_decodedBodyLength;
422 434
423 // The downloaded file path if the load streamed to a file. 435 // The downloaded file path if the load streamed to a file.
424 String m_downloadedFilePath; 436 String m_downloadedFilePath;
425 437
426 // The handle to the downloaded file to ensure the underlying file will not 438 // The handle to the downloaded file to ensure the underlying file will not
427 // be deleted. 439 // be deleted.
428 RefPtr<BlobDataHandle> m_downloadedFileHandle; 440 RefPtr<BlobDataHandle> m_downloadedFileHandle;
429 441
430 // ExtraData associated with the response. 442 // ExtraData associated with the response.
431 RefPtr<ExtraData> m_extraData; 443 RefPtr<ExtraData> m_extraData;
444
445 // PlzNavigate: the redirect responses are transmitted
446 // inside the final response.
447 Vector<ResourceResponse> m_redirectResponses;
432 }; 448 };
433 449
434 inline bool operator==(const ResourceResponse& a, const ResourceResponse& b) { r eturn ResourceResponse::compare(a, b); } 450 inline bool operator==(const ResourceResponse& a, const ResourceResponse& b) { r eturn ResourceResponse::compare(a, b); }
435 inline bool operator!=(const ResourceResponse& a, const ResourceResponse& b) { r eturn !(a == b); } 451 inline bool operator!=(const ResourceResponse& a, const ResourceResponse& b) { r eturn !(a == b); }
436 452
437 struct CrossThreadResourceResponseData { 453 struct CrossThreadResourceResponseData {
438 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData); USING_FAST_MALLOC(Cro ssThreadResourceResponseData); 454 WTF_MAKE_NONCOPYABLE(CrossThreadResourceResponseData); USING_FAST_MALLOC(Cro ssThreadResourceResponseData);
439 public: 455 public:
440 CrossThreadResourceResponseData() { } 456 CrossThreadResourceResponseData() { }
441 KURL m_url; 457 KURL m_url;
(...skipping 22 matching lines...) Expand all
464 bool m_wasFetchedViaProxy; 480 bool m_wasFetchedViaProxy;
465 bool m_wasFetchedViaServiceWorker; 481 bool m_wasFetchedViaServiceWorker;
466 bool m_wasFetchedViaForeignFetch; 482 bool m_wasFetchedViaForeignFetch;
467 bool m_wasFallbackRequiredByServiceWorker; 483 bool m_wasFallbackRequiredByServiceWorker;
468 WebServiceWorkerResponseType m_serviceWorkerResponseType; 484 WebServiceWorkerResponseType m_serviceWorkerResponseType;
469 KURL m_originalURLViaServiceWorker; 485 KURL m_originalURLViaServiceWorker;
470 String m_cacheStorageCacheName; 486 String m_cacheStorageCacheName;
471 int64_t m_responseTime; 487 int64_t m_responseTime;
472 String m_remoteIPAddress; 488 String m_remoteIPAddress;
473 unsigned short m_remotePort; 489 unsigned short m_remotePort;
490 long long m_encodedDataLength;
474 long long m_encodedBodyLength; 491 long long m_encodedBodyLength;
475 long long m_decodedBodyLength; 492 long long m_decodedBodyLength;
476 String m_downloadedFilePath; 493 String m_downloadedFilePath;
477 RefPtr<BlobDataHandle> m_downloadedFileHandle; 494 RefPtr<BlobDataHandle> m_downloadedFileHandle;
478 }; 495 };
479 496
480 } // namespace blink 497 } // namespace blink
481 498
482 #endif // ResourceResponse_h 499 #endif // ResourceResponse_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698