OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
6 #define WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLResponse.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLResponse.h" |
13 #include "webkit/glue/webkit_glue_export.h" | 13 #include "webkit/glue/webkit_glue_export.h" |
14 | 14 |
15 namespace webkit_glue { | 15 namespace webkit_glue { |
16 | 16 |
17 // Base class for Chrome's implementation of the "extra data". | 17 // Base class for Chrome's implementation of the "extra data". |
18 class WEBKIT_GLUE_EXPORT WebURLResponseExtraDataImpl | 18 class WEBKIT_GLUE_EXPORT WebURLResponseExtraDataImpl |
19 : NON_EXPORTED_BASE(public WebKit::WebURLResponse::ExtraData) { | 19 : NON_EXPORTED_BASE(public WebKit::WebURLResponse::ExtraData) { |
20 public: | 20 public: |
21 explicit WebURLResponseExtraDataImpl( | 21 explicit WebURLResponseExtraDataImpl( |
22 const std::string& npn_negotiated_protocol); | 22 const std::string& npn_negotiated_protocol); |
23 virtual ~WebURLResponseExtraDataImpl(); | 23 virtual ~WebURLResponseExtraDataImpl(); |
24 | 24 |
25 const std::string& npn_negotiated_protocol() const { | 25 const std::string& npn_negotiated_protocol() const { |
26 return npn_negotiated_protocol_; | 26 return npn_negotiated_protocol_; |
27 } | 27 } |
| 28 |
| 29 // Flag whether this request was loaded via an explicit proxy |
| 30 // (HTTP, SOCKS, etc). |
| 31 bool was_fetched_via_proxy() const { |
| 32 return was_fetched_via_proxy_; |
| 33 } |
| 34 void set_was_fetched_via_proxy(bool was_fetched_via_proxy) { |
| 35 was_fetched_via_proxy_ = was_fetched_via_proxy; |
| 36 } |
| 37 |
| 38 /// Flag whether this request was loaded via the SPDY protocol or not. |
| 39 // SPDY is an experimental web protocol, see http://dev.chromium.org/spdy |
| 40 bool was_fetched_via_spdy() const { |
| 41 return was_fetched_via_spdy_; |
| 42 } |
| 43 void set_was_fetched_via_spdy(bool was_fetched_via_spdy) { |
| 44 was_fetched_via_spdy_ = was_fetched_via_spdy; |
| 45 } |
| 46 |
| 47 // Flag whether this request was loaded after the |
| 48 // TLS/Next-Protocol-Negotiation was used. |
| 49 // This is related to SPDY. |
| 50 bool was_npn_negotiated() const { |
| 51 return was_npn_negotiated_; |
| 52 } |
| 53 void set_was_npn_negotiated(bool was_npn_negotiated) { |
| 54 was_npn_negotiated_ = was_npn_negotiated; |
| 55 } |
| 56 |
| 57 // Flag whether this request was made when "Alternate-Protocol: xxx" |
| 58 // is present in server's response. |
| 59 bool was_alternate_protocol_available() const { |
| 60 return was_alternate_protocol_available_; |
| 61 } |
| 62 void set_was_alternate_protocol_available( |
| 63 bool was_alternate_protocol_available) { |
| 64 was_alternate_protocol_available_ = was_alternate_protocol_available; |
| 65 } |
| 66 |
28 bool is_ftp_directory_listing() const { return is_ftp_directory_listing_; } | 67 bool is_ftp_directory_listing() const { return is_ftp_directory_listing_; } |
29 void set_is_ftp_directory_listing(bool is_ftp_directory_listing) { | 68 void set_is_ftp_directory_listing(bool is_ftp_directory_listing) { |
30 is_ftp_directory_listing_ = is_ftp_directory_listing; | 69 is_ftp_directory_listing_ = is_ftp_directory_listing; |
31 } | 70 } |
32 | 71 |
33 | |
34 private: | 72 private: |
35 std::string npn_negotiated_protocol_; | 73 std::string npn_negotiated_protocol_; |
36 bool is_ftp_directory_listing_; | 74 bool is_ftp_directory_listing_; |
| 75 bool was_fetched_via_proxy_; |
| 76 bool was_fetched_via_spdy_; |
| 77 bool was_npn_negotiated_; |
| 78 bool was_alternate_protocol_available_; |
37 | 79 |
38 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); | 80 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); |
39 }; | 81 }; |
40 | 82 |
41 } // namespace webkit_glue | 83 } // namespace webkit_glue |
42 | 84 |
43 #endif // WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 85 #endif // WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
OLD | NEW |