Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 String ResourceResponse::ConnectionInfoString() const { | |
| 578 std::string connection_info_string = | |
| 579 net::HttpResponseInfo::ConnectionInfoToString(connection_info_); | |
| 580 return String::FromUTF8(connection_info_string.c_str(), | |
|
haraken
2017/06/23 03:58:04
Can we use AtomicString(connection_info_string.dat
shaseley
2017/06/23 16:39:22
I see, to avoid the conversion from String to Atom
| |
| 581 connection_info_string.size()); | |
| 582 } | |
| 583 | |
| 575 void ResourceResponse::SetEncodedDataLength(long long value) { | 584 void ResourceResponse::SetEncodedDataLength(long long value) { |
| 576 encoded_data_length_ = value; | 585 encoded_data_length_ = value; |
| 577 } | 586 } |
| 578 | 587 |
| 579 void ResourceResponse::SetEncodedBodyLength(long long value) { | 588 void ResourceResponse::SetEncodedBodyLength(long long value) { |
| 580 encoded_body_length_ = value; | 589 encoded_body_length_ = value; |
| 581 } | 590 } |
| 582 | 591 |
| 583 void ResourceResponse::SetDecodedBodyLength(long long value) { | 592 void ResourceResponse::SetDecodedBodyLength(long long value) { |
| 584 decoded_body_length_ = value; | 593 decoded_body_length_ = value; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 if (a.GetResourceLoadTiming() != b.GetResourceLoadTiming()) | 636 if (a.GetResourceLoadTiming() != b.GetResourceLoadTiming()) |
| 628 return false; | 637 return false; |
| 629 if (a.EncodedBodyLength() != b.EncodedBodyLength()) | 638 if (a.EncodedBodyLength() != b.EncodedBodyLength()) |
| 630 return false; | 639 return false; |
| 631 if (a.DecodedBodyLength() != b.DecodedBodyLength()) | 640 if (a.DecodedBodyLength() != b.DecodedBodyLength()) |
| 632 return false; | 641 return false; |
| 633 return true; | 642 return true; |
| 634 } | 643 } |
| 635 | 644 |
| 636 } // namespace blink | 645 } // namespace blink |
| OLD | NEW |