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 "net/http/http_response_info.h" | 13 #include "net/http/http_response_info.h" |
14 #include "net/nqe/effective_connection_type.h" | 14 #include "net/nqe/effective_connection_type.h" |
15 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 15 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class CONTENT_EXPORT WebURLResponseExtraDataImpl : | 19 class CONTENT_EXPORT WebURLResponseExtraDataImpl : |
20 public NON_EXPORTED_BASE(blink::WebURLResponse::ExtraData) { | 20 public NON_EXPORTED_BASE(blink::WebURLResponse::ExtraData) { |
21 public: | 21 public: |
22 explicit WebURLResponseExtraDataImpl( | 22 explicit WebURLResponseExtraDataImpl( |
23 const std::string& npn_negotiated_protocol); | 23 const std::string& alpn_negotiated_protocol); |
24 ~WebURLResponseExtraDataImpl() override; | 24 ~WebURLResponseExtraDataImpl() override; |
25 | 25 |
26 const std::string& npn_negotiated_protocol() const { | 26 const std::string& alpn_negotiated_protocol() const { |
27 return npn_negotiated_protocol_; | 27 return alpn_negotiated_protocol_; |
28 } | 28 } |
29 | 29 |
30 // Flag whether this request was loaded via an explicit proxy | 30 // Flag whether this request was loaded via an explicit proxy |
31 // (HTTP, SOCKS, etc). | 31 // (HTTP, SOCKS, etc). |
32 bool was_fetched_via_proxy() const { | 32 bool was_fetched_via_proxy() const { |
33 return was_fetched_via_proxy_; | 33 return was_fetched_via_proxy_; |
34 } | 34 } |
35 void set_was_fetched_via_proxy(bool was_fetched_via_proxy) { | 35 void set_was_fetched_via_proxy(bool was_fetched_via_proxy) { |
36 was_fetched_via_proxy_ = was_fetched_via_proxy; | 36 was_fetched_via_proxy_ = was_fetched_via_proxy; |
37 } | 37 } |
(...skipping 21 matching lines...) Expand all Loading... |
59 return connection_info_; | 59 return connection_info_; |
60 } | 60 } |
61 void set_connection_info( | 61 void set_connection_info( |
62 net::HttpResponseInfo::ConnectionInfo connection_info) { | 62 net::HttpResponseInfo::ConnectionInfo connection_info) { |
63 connection_info_ = connection_info; | 63 connection_info_ = connection_info; |
64 } | 64 } |
65 | 65 |
66 // Flag whether this request was loaded after the | 66 // Flag whether this request was loaded after the |
67 // TLS/Next-Protocol-Negotiation was used. | 67 // TLS/Next-Protocol-Negotiation was used. |
68 // This is related to SPDY. | 68 // This is related to SPDY. |
69 bool was_npn_negotiated() const { | 69 bool was_alpn_negotiated() const { return was_alpn_negotiated_; } |
70 return was_npn_negotiated_; | 70 void set_was_alpn_negotiated(bool was_alpn_negotiated) { |
71 } | 71 was_alpn_negotiated_ = was_alpn_negotiated; |
72 void set_was_npn_negotiated(bool was_npn_negotiated) { | |
73 was_npn_negotiated_ = was_npn_negotiated; | |
74 } | 72 } |
75 | 73 |
76 // Flag whether this request was made when "Alternate-Protocol: xxx" | 74 // Flag whether this request was made when "Alternate-Protocol: xxx" |
77 // is present in server's response. | 75 // is present in server's response. |
78 bool was_alternate_protocol_available() const { | 76 bool was_alternate_protocol_available() const { |
79 return was_alternate_protocol_available_; | 77 return was_alternate_protocol_available_; |
80 } | 78 } |
81 void set_was_alternate_protocol_available( | 79 void set_was_alternate_protocol_available( |
82 bool was_alternate_protocol_available) { | 80 bool was_alternate_protocol_available) { |
83 was_alternate_protocol_available_ = was_alternate_protocol_available; | 81 was_alternate_protocol_available_ = was_alternate_protocol_available; |
84 } | 82 } |
85 | 83 |
86 bool is_ftp_directory_listing() const { return is_ftp_directory_listing_; } | 84 bool is_ftp_directory_listing() const { return is_ftp_directory_listing_; } |
87 void set_is_ftp_directory_listing(bool is_ftp_directory_listing) { | 85 void set_is_ftp_directory_listing(bool is_ftp_directory_listing) { |
88 is_ftp_directory_listing_ = is_ftp_directory_listing; | 86 is_ftp_directory_listing_ = is_ftp_directory_listing; |
89 } | 87 } |
90 | 88 |
91 bool is_using_lofi() const { return is_using_lofi_; } | 89 bool is_using_lofi() const { return is_using_lofi_; } |
92 void set_is_using_lofi(bool is_using_lofi) { is_using_lofi_ = is_using_lofi; } | 90 void set_is_using_lofi(bool is_using_lofi) { is_using_lofi_ = is_using_lofi; } |
93 | 91 |
94 net::EffectiveConnectionType effective_connection_type() const { | 92 net::EffectiveConnectionType effective_connection_type() const { |
95 return effective_connection_type_; | 93 return effective_connection_type_; |
96 } | 94 } |
97 void set_effective_connection_type( | 95 void set_effective_connection_type( |
98 net::EffectiveConnectionType effective_connection_type) { | 96 net::EffectiveConnectionType effective_connection_type) { |
99 effective_connection_type_ = effective_connection_type; | 97 effective_connection_type_ = effective_connection_type; |
100 } | 98 } |
101 | 99 |
102 private: | 100 private: |
103 std::string npn_negotiated_protocol_; | 101 std::string alpn_negotiated_protocol_; |
104 bool is_ftp_directory_listing_; | 102 bool is_ftp_directory_listing_; |
105 bool was_fetched_via_proxy_; | 103 bool was_fetched_via_proxy_; |
106 net::HostPortPair proxy_server_; | 104 net::HostPortPair proxy_server_; |
107 bool was_fetched_via_spdy_; | 105 bool was_fetched_via_spdy_; |
108 bool was_npn_negotiated_; | 106 bool was_alpn_negotiated_; |
109 net::HttpResponseInfo::ConnectionInfo connection_info_; | 107 net::HttpResponseInfo::ConnectionInfo connection_info_; |
110 bool was_alternate_protocol_available_; | 108 bool was_alternate_protocol_available_; |
111 bool is_using_lofi_; | 109 bool is_using_lofi_; |
112 net::EffectiveConnectionType effective_connection_type_; | 110 net::EffectiveConnectionType effective_connection_type_; |
113 | 111 |
114 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); | 112 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); |
115 }; | 113 }; |
116 | 114 |
117 } // namespace content | 115 } // namespace content |
118 | 116 |
119 #endif // CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 117 #endif // CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
OLD | NEW |