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& alpn_negotiated_protocol); | 23 const std::string& alpn_negotiated_protocol); |
24 ~WebURLResponseExtraDataImpl() override; | 24 ~WebURLResponseExtraDataImpl() override; |
25 | 25 |
26 const std::string& alpn_negotiated_protocol() const { | 26 const std::string& alpn_negotiated_protocol() const { |
27 return alpn_negotiated_protocol_; | 27 return alpn_negotiated_protocol_; |
28 } | 28 } |
29 | 29 |
30 // Flag whether this request was loaded via an explicit proxy | |
31 // (HTTP, SOCKS, etc). | |
32 bool was_fetched_via_proxy() const { | |
33 return was_fetched_via_proxy_; | |
34 } | |
35 void set_was_fetched_via_proxy(bool was_fetched_via_proxy) { | |
36 was_fetched_via_proxy_ = was_fetched_via_proxy; | |
37 } | |
38 | |
39 // The proxy server used if this request was loaded via an explicit proxy | |
40 // (HTTP, SOCKS, etc). | |
41 net::HostPortPair proxy_server() const { | |
42 return proxy_server_; | |
43 } | |
44 void set_proxy_server(net::HostPortPair proxy_server) { | |
45 proxy_server_ = proxy_server; | |
46 } | |
47 | |
48 /// Flag whether this request was loaded via the SPDY protocol or not. | 30 /// Flag whether this request was loaded via the SPDY protocol or not. |
49 // SPDY is an experimental web protocol, see http://dev.chromium.org/spdy | 31 // SPDY is an experimental web protocol, see http://dev.chromium.org/spdy |
50 bool was_fetched_via_spdy() const { | 32 bool was_fetched_via_spdy() const { |
51 return was_fetched_via_spdy_; | 33 return was_fetched_via_spdy_; |
52 } | 34 } |
53 void set_was_fetched_via_spdy(bool was_fetched_via_spdy) { | 35 void set_was_fetched_via_spdy(bool was_fetched_via_spdy) { |
54 was_fetched_via_spdy_ = was_fetched_via_spdy; | 36 was_fetched_via_spdy_ = was_fetched_via_spdy; |
55 } | 37 } |
56 | 38 |
57 // Information about the type of connection used to fetch this response. | 39 // Information about the type of connection used to fetch this response. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return effective_connection_type_; | 75 return effective_connection_type_; |
94 } | 76 } |
95 void set_effective_connection_type( | 77 void set_effective_connection_type( |
96 net::EffectiveConnectionType effective_connection_type) { | 78 net::EffectiveConnectionType effective_connection_type) { |
97 effective_connection_type_ = effective_connection_type; | 79 effective_connection_type_ = effective_connection_type; |
98 } | 80 } |
99 | 81 |
100 private: | 82 private: |
101 std::string alpn_negotiated_protocol_; | 83 std::string alpn_negotiated_protocol_; |
102 bool is_ftp_directory_listing_; | 84 bool is_ftp_directory_listing_; |
103 bool was_fetched_via_proxy_; | |
104 net::HostPortPair proxy_server_; | |
105 bool was_fetched_via_spdy_; | 85 bool was_fetched_via_spdy_; |
106 bool was_alpn_negotiated_; | 86 bool was_alpn_negotiated_; |
107 net::HttpResponseInfo::ConnectionInfo connection_info_; | 87 net::HttpResponseInfo::ConnectionInfo connection_info_; |
108 bool was_alternate_protocol_available_; | 88 bool was_alternate_protocol_available_; |
109 bool is_using_lofi_; | 89 bool is_using_lofi_; |
110 net::EffectiveConnectionType effective_connection_type_; | 90 net::EffectiveConnectionType effective_connection_type_; |
111 | 91 |
112 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); | 92 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); |
113 }; | 93 }; |
114 | 94 |
115 } // namespace content | 95 } // namespace content |
116 | 96 |
117 #endif // CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 97 #endif // CONTENT_CHILD_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
OLD | NEW |