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
3 // found in the LICENSE file.
5 #ifndef WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_
6 #define WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebURLResponse.h"
13 #include "webkit/glue/webkit_glue_export.h"
15 namespace webkit_glue
{
17 // Base class for Chrome's implementation of the "extra data".
18 class WEBKIT_GLUE_EXPORT WebURLResponseExtraDataImpl
19 : NON_EXPORTED_BASE(public WebKit::WebURLResponse::ExtraData
) {
21 explicit WebURLResponseExtraDataImpl(
22 const std::string
& npn_negotiated_protocol
);
23 virtual ~WebURLResponseExtraDataImpl();
25 const std::string
& npn_negotiated_protocol() const {
26 return npn_negotiated_protocol_
;
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_
;
34 void set_was_fetched_via_proxy(bool was_fetched_via_proxy
) {
35 was_fetched_via_proxy_
= was_fetched_via_proxy
;
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_
;
43 void set_was_fetched_via_spdy(bool was_fetched_via_spdy
) {
44 was_fetched_via_spdy_
= was_fetched_via_spdy
;
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_
;
53 void set_was_npn_negotiated(bool was_npn_negotiated
) {
54 was_npn_negotiated_
= was_npn_negotiated
;
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_
;
62 void set_was_alternate_protocol_available(
63 bool was_alternate_protocol_available
) {
64 was_alternate_protocol_available_
= was_alternate_protocol_available
;
67 bool is_ftp_directory_listing() const { return is_ftp_directory_listing_
; }
68 void set_is_ftp_directory_listing(bool is_ftp_directory_listing
) {
69 is_ftp_directory_listing_
= is_ftp_directory_listing
;
73 std::string npn_negotiated_protocol_
;
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_
;
80 DISALLOW_COPY_AND_ASSIGN(WebURLResponseExtraDataImpl
);
83 } // namespace webkit_glue
85 #endif // WEBKIT_GLUE_WEBURLRESPONSE_EXTRADATA_IMPL_H_