Chromium Code Reviews| 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 wasFetchedViaProxy() const { | |
|
darin (slow to review)
2013/03/04 05:35:48
nit: please use google C++ style since this is chr
Ryan Hamilton
2013/03/04 17:27:09
Oh, good point! Done.
| |
| 32 return was_fetched_via_proxy_; | |
| 33 } | |
| 34 void setWasFetchedViaProxy(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 wasFetchedViaSPDY() const { | |
| 41 return was_fetched_via_spdy_; | |
| 42 } | |
| 43 void setWasFetchedViaSPDY(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 wasNpnNegotiated() const { | |
| 51 return was_npn_negotiated_; | |
| 52 } | |
| 53 void setWasNpnNegotiated(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 wasAlternateProtocolAvailable() const { | |
| 60 return was_alternate_protocol_available_; | |
| 61 } | |
| 62 void setWasAlternateProtocolAvailable(bool was_alternate_protocol_available) { | |
| 63 was_alternate_protocol_available_ = was_alternate_protocol_available; | |
| 64 } | |
| 65 | |
| 28 bool is_ftp_directory_listing() const { return is_ftp_directory_listing_; } | 66 bool is_ftp_directory_listing() const { return is_ftp_directory_listing_; } |
| 29 void set_is_ftp_directory_listing(bool is_ftp_directory_listing) { | 67 void set_is_ftp_directory_listing(bool is_ftp_directory_listing) { |
| 30 is_ftp_directory_listing_ = is_ftp_directory_listing; | 68 is_ftp_directory_listing_ = is_ftp_directory_listing; |
| 31 } | 69 } |
| 32 | 70 |
| 33 | |
| 34 private: | 71 private: |
| 35 std::string npn_negotiated_protocol_; | 72 std::string npn_negotiated_protocol_; |
| 36 bool is_ftp_directory_listing_; | 73 bool is_ftp_directory_listing_; |
| 74 bool was_fetched_via_proxy_; | |
| 75 bool was_fetched_via_spdy_; | |
| 76 bool was_npn_negotiated_; | |
| 77 bool was_alternate_protocol_available_; | |
| 37 | 78 |
| 38 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); | 79 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl); |
| 39 }; | 80 }; |
| 40 | 81 |
| 41 } // namespace webkit_glue | 82 } // namespace webkit_glue |
| 42 | 83 |
| 43 #endif // WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ | 84 #endif // WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_ |
| OLD | NEW |