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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.cpp

Issue 2932003002: Implement nextHopProtocol in PerformanceResourceTiming and PerformanceNavigationTiming. (Closed)
Patch Set: Added net/http dependency Created 3 years, 6 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 app_cache_id_(0), 94 app_cache_id_(0),
95 was_fetched_via_spdy_(false), 95 was_fetched_via_spdy_(false),
96 was_fetched_via_proxy_(false), 96 was_fetched_via_proxy_(false),
97 was_fetched_via_service_worker_(false), 97 was_fetched_via_service_worker_(false),
98 was_fetched_via_foreign_fetch_(false), 98 was_fetched_via_foreign_fetch_(false),
99 was_fallback_required_by_service_worker_(false), 99 was_fallback_required_by_service_worker_(false),
100 service_worker_response_type_(kWebServiceWorkerResponseTypeDefault), 100 service_worker_response_type_(kWebServiceWorkerResponseTypeDefault),
101 did_service_worker_navigation_preload_(false), 101 did_service_worker_navigation_preload_(false),
102 response_time_(0), 102 response_time_(0),
103 remote_port_(0), 103 remote_port_(0),
104 connection_info_(
105 net::HttpResponseInfo::ConnectionInfo::CONNECTION_INFO_UNKNOWN),
104 encoded_data_length_(0), 106 encoded_data_length_(0),
105 encoded_body_length_(0), 107 encoded_body_length_(0),
106 decoded_body_length_(0) {} 108 decoded_body_length_(0) {}
107 109
108 ResourceResponse::ResourceResponse(const KURL& url, 110 ResourceResponse::ResourceResponse(const KURL& url,
109 const AtomicString& mime_type, 111 const AtomicString& mime_type,
110 long long expected_length, 112 long long expected_length,
111 const AtomicString& text_encoding_name) 113 const AtomicString& text_encoding_name)
112 : url_(url), 114 : url_(url),
113 mime_type_(mime_type), 115 mime_type_(mime_type),
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 PassRefPtr<ResourceLoadInfo> load_info) { 568 PassRefPtr<ResourceLoadInfo> load_info) {
567 resource_load_info_ = std::move(load_info); 569 resource_load_info_ = std::move(load_info);
568 } 570 }
569 571
570 KURL ResourceResponse::OriginalURLViaServiceWorker() const { 572 KURL ResourceResponse::OriginalURLViaServiceWorker() const {
571 if (url_list_via_service_worker_.IsEmpty()) 573 if (url_list_via_service_worker_.IsEmpty())
572 return KURL(); 574 return KURL();
573 return url_list_via_service_worker_.back(); 575 return url_list_via_service_worker_.back();
574 } 576 }
575 577
578 String ResourceResponse::ConnectionInfoString() const {
579 std::string connectionInfoStr =
kinuko 2017/06/12 00:48:23 connectionInfoStr -> connection_info_string (no ab
shaseley 2017/06/13 23:14:18 Done.
580 net::HttpResponseInfo::ConnectionInfoToString(connection_info_);
581 return String::FromUTF8(connectionInfoStr.c_str(), connectionInfoStr.size());
582 }
583
576 void ResourceResponse::SetEncodedDataLength(long long value) { 584 void ResourceResponse::SetEncodedDataLength(long long value) {
577 encoded_data_length_ = value; 585 encoded_data_length_ = value;
578 } 586 }
579 587
580 void ResourceResponse::SetEncodedBodyLength(long long value) { 588 void ResourceResponse::SetEncodedBodyLength(long long value) {
581 encoded_body_length_ = value; 589 encoded_body_length_ = value;
582 } 590 }
583 591
584 void ResourceResponse::SetDecodedBodyLength(long long value) { 592 void ResourceResponse::SetDecodedBodyLength(long long value) {
585 decoded_body_length_ = value; 593 decoded_body_length_ = value;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 if (a.GetResourceLoadTiming() != b.GetResourceLoadTiming()) 636 if (a.GetResourceLoadTiming() != b.GetResourceLoadTiming())
629 return false; 637 return false;
630 if (a.EncodedBodyLength() != b.EncodedBodyLength()) 638 if (a.EncodedBodyLength() != b.EncodedBodyLength())
631 return false; 639 return false;
632 if (a.DecodedBodyLength() != b.DecodedBodyLength()) 640 if (a.DecodedBodyLength() != b.DecodedBodyLength())
633 return false; 641 return false;
634 return true; 642 return true;
635 } 643 }
636 644
637 } // namespace blink 645 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698