| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 5 #ifndef CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
| 6 #define CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 6 #define CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/common/previews_state.h" | 13 #include "content/public/common/previews_state.h" |
| 14 #include "net/http/http_response_info.h" | 14 #include "net/http/http_response_info.h" |
| 15 #include "net/nqe/effective_connection_type.h" | 15 #include "net/nqe/effective_connection_type.h" |
| 16 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 16 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class CONTENT_EXPORT WebURLResponseExtraDataImpl : | 20 class CONTENT_EXPORT WebURLResponseExtraDataImpl : |
| 21 public NON_EXPORTED_BASE(blink::WebURLResponse::ExtraData) { | 21 public NON_EXPORTED_BASE(blink::WebURLResponse::ExtraData) { |
| 22 public: | 22 public: |
| 23 explicit WebURLResponseExtraDataImpl( | 23 WebURLResponseExtraDataImpl(); |
| 24 const std::string& alpn_negotiated_protocol); | |
| 25 ~WebURLResponseExtraDataImpl() override; | 24 ~WebURLResponseExtraDataImpl() override; |
| 26 | 25 |
| 27 const std::string& alpn_negotiated_protocol() const { | |
| 28 return alpn_negotiated_protocol_; | |
| 29 } | |
| 30 | |
| 31 /// Flag whether this request was loaded via the SPDY protocol or not. | 26 /// Flag whether this request was loaded via the SPDY protocol or not. |
| 32 // SPDY is an experimental web protocol, see http://dev.chromium.org/spdy | 27 // SPDY is an experimental web protocol, see http://dev.chromium.org/spdy |
| 33 bool was_fetched_via_spdy() const { | 28 bool was_fetched_via_spdy() const { |
| 34 return was_fetched_via_spdy_; | 29 return was_fetched_via_spdy_; |
| 35 } | 30 } |
| 36 void set_was_fetched_via_spdy(bool was_fetched_via_spdy) { | 31 void set_was_fetched_via_spdy(bool was_fetched_via_spdy) { |
| 37 was_fetched_via_spdy_ = was_fetched_via_spdy; | 32 was_fetched_via_spdy_ = was_fetched_via_spdy; |
| 38 } | 33 } |
| 39 | 34 |
| 40 // Information about the type of connection used to fetch this response. | |
| 41 net::HttpResponseInfo::ConnectionInfo connection_info() const { | |
| 42 return connection_info_; | |
| 43 } | |
| 44 void set_connection_info( | |
| 45 net::HttpResponseInfo::ConnectionInfo connection_info) { | |
| 46 connection_info_ = connection_info; | |
| 47 } | |
| 48 | |
| 49 // Flag whether this request was loaded after the | 35 // Flag whether this request was loaded after the |
| 50 // TLS/Next-Protocol-Negotiation was used. | 36 // TLS/Next-Protocol-Negotiation was used. |
| 51 // This is related to SPDY. | 37 // This is related to SPDY. |
| 52 bool was_alpn_negotiated() const { return was_alpn_negotiated_; } | 38 bool was_alpn_negotiated() const { return was_alpn_negotiated_; } |
| 53 void set_was_alpn_negotiated(bool was_alpn_negotiated) { | 39 void set_was_alpn_negotiated(bool was_alpn_negotiated) { |
| 54 was_alpn_negotiated_ = was_alpn_negotiated; | 40 was_alpn_negotiated_ = was_alpn_negotiated; |
| 55 } | 41 } |
| 56 | 42 |
| 57 // Flag whether this request was made when "Alternate-Protocol: xxx" | 43 // Flag whether this request was made when "Alternate-Protocol: xxx" |
| 58 // is present in server's response. | 44 // is present in server's response. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 77 | 63 |
| 78 net::EffectiveConnectionType effective_connection_type() const { | 64 net::EffectiveConnectionType effective_connection_type() const { |
| 79 return effective_connection_type_; | 65 return effective_connection_type_; |
| 80 } | 66 } |
| 81 void set_effective_connection_type( | 67 void set_effective_connection_type( |
| 82 net::EffectiveConnectionType effective_connection_type) { | 68 net::EffectiveConnectionType effective_connection_type) { |
| 83 effective_connection_type_ = effective_connection_type; | 69 effective_connection_type_ = effective_connection_type; |
| 84 } | 70 } |
| 85 | 71 |
| 86 private: | 72 private: |
| 87 std::string alpn_negotiated_protocol_; | |
| 88 bool is_ftp_directory_listing_; | 73 bool is_ftp_directory_listing_; |
| 89 bool was_fetched_via_spdy_; | 74 bool was_fetched_via_spdy_; |
| 90 bool was_alpn_negotiated_; | 75 bool was_alpn_negotiated_; |
| 91 net::HttpResponseInfo::ConnectionInfo connection_info_; | |
| 92 bool was_alternate_protocol_available_; | 76 bool was_alternate_protocol_available_; |
| 93 PreviewsState previews_state_; | 77 PreviewsState previews_state_; |
| 94 net::EffectiveConnectionType effective_connection_type_; | 78 net::EffectiveConnectionType effective_connection_type_; |
| 95 | 79 |
| 96 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); | 80 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); |
| 97 }; | 81 }; |
| 98 | 82 |
| 99 } // namespace content | 83 } // namespace content |
| 100 | 84 |
| 101 #endif // CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 85 #endif // CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
| OLD | NEW |