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

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

Issue 2932003002: Implement nextHopProtocol in PerformanceResourceTiming and PerformanceNavigationTiming. (Closed)
Patch Set: Make ConnectionInfoString() return AtomicString 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 did_service_worker_navigation_preload_(false), 94 did_service_worker_navigation_preload_(false),
95 service_worker_response_type_(kWebServiceWorkerResponseTypeDefault), 95 service_worker_response_type_(kWebServiceWorkerResponseTypeDefault),
96 http_version_(kHTTPVersionUnknown), 96 http_version_(kHTTPVersionUnknown),
97 security_style_(kSecurityStyleUnknown), 97 security_style_(kSecurityStyleUnknown),
98 age_(0.0), 98 age_(0.0),
99 date_(0.0), 99 date_(0.0),
100 expires_(0.0), 100 expires_(0.0),
101 last_modified_(0.0), 101 last_modified_(0.0),
102 app_cache_id_(0), 102 app_cache_id_(0),
103 response_time_(0), 103 response_time_(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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 void ResourceResponse::SetResourceLoadInfo(RefPtr<ResourceLoadInfo> load_info) { 567 void ResourceResponse::SetResourceLoadInfo(RefPtr<ResourceLoadInfo> load_info) {
566 resource_load_info_ = std::move(load_info); 568 resource_load_info_ = std::move(load_info);
567 } 569 }
568 570
569 KURL ResourceResponse::OriginalURLViaServiceWorker() const { 571 KURL ResourceResponse::OriginalURLViaServiceWorker() const {
570 if (url_list_via_service_worker_.IsEmpty()) 572 if (url_list_via_service_worker_.IsEmpty())
571 return KURL(); 573 return KURL();
572 return url_list_via_service_worker_.back(); 574 return url_list_via_service_worker_.back();
573 } 575 }
574 576
577 AtomicString ResourceResponse::ConnectionInfoString() const {
578 std::string connection_info_string =
579 net::HttpResponseInfo::ConnectionInfoToString(connection_info_);
580 return AtomicString(
581 reinterpret_cast<const LChar*>(connection_info_string.data()),
582 connection_info_string.length());
583 }
584
575 void ResourceResponse::SetEncodedDataLength(long long value) { 585 void ResourceResponse::SetEncodedDataLength(long long value) {
576 encoded_data_length_ = value; 586 encoded_data_length_ = value;
577 } 587 }
578 588
579 void ResourceResponse::SetEncodedBodyLength(long long value) { 589 void ResourceResponse::SetEncodedBodyLength(long long value) {
580 encoded_body_length_ = value; 590 encoded_body_length_ = value;
581 } 591 }
582 592
583 void ResourceResponse::SetDecodedBodyLength(long long value) { 593 void ResourceResponse::SetDecodedBodyLength(long long value) {
584 decoded_body_length_ = value; 594 decoded_body_length_ = value;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 if (a.GetResourceLoadTiming() != b.GetResourceLoadTiming()) 637 if (a.GetResourceLoadTiming() != b.GetResourceLoadTiming())
628 return false; 638 return false;
629 if (a.EncodedBodyLength() != b.EncodedBodyLength()) 639 if (a.EncodedBodyLength() != b.EncodedBodyLength())
630 return false; 640 return false;
631 if (a.DecodedBodyLength() != b.DecodedBodyLength()) 641 if (a.DecodedBodyLength() != b.DecodedBodyLength())
632 return false; 642 return false;
633 return true; 643 return true;
634 } 644 }
635 645
636 } // namespace blink 646 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698