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 CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ |
6 #define CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ | 6 #define CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/supports_user_data.h" | 12 #include "base/supports_user_data.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "net/http/http_response_info.h" | 15 #include "net/http/http_response_info.h" |
16 #include "third_party/WebKit/public/web/WebDataSource.h" | 16 #include "third_party/WebKit/public/web/WebDataSource.h" |
17 #include "url/gurl.h" | |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 | 20 |
20 class NavigationState; | 21 class NavigationState; |
21 | 22 |
22 // The RenderView stores an instance of this class in the "extra data" of each | 23 // The RenderView stores an instance of this class in the "extra data" of each |
23 // WebDataSource (see RenderView::DidCreateDataSource). | 24 // WebDataSource (see RenderView::DidCreateDataSource). |
24 class CONTENT_EXPORT DocumentState | 25 class CONTENT_EXPORT DocumentState |
25 : NON_EXPORTED_BASE(public blink::WebDataSource::ExtraData), | 26 : NON_EXPORTED_BASE(public blink::WebDataSource::ExtraData), |
26 public base::SupportsUserData { | 27 public base::SupportsUserData { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 } | 175 } |
175 bool was_referred_by_prefetcher() const { | 176 bool was_referred_by_prefetcher() const { |
176 return was_referred_by_prefetcher_; | 177 return was_referred_by_prefetcher_; |
177 } | 178 } |
178 | 179 |
179 void set_was_after_preconnect_request(bool value) { | 180 void set_was_after_preconnect_request(bool value) { |
180 was_after_preconnect_request_ = value; | 181 was_after_preconnect_request_ = value; |
181 } | 182 } |
182 bool was_after_preconnect_request() { return was_after_preconnect_request_; } | 183 bool was_after_preconnect_request() { return was_after_preconnect_request_; } |
183 | 184 |
185 void set_was_load_data_with_base_url_request(bool value) { | |
Charlie Reis
2015/11/24 00:22:59
nit: Comment on this block mentioning LoadDataWith
boliu
2015/11/24 19:03:25
Done.
| |
186 was_load_data_with_base_url_request_ = value; | |
187 } | |
188 bool was_load_data_with_base_url_request() const { | |
189 return was_load_data_with_base_url_request_; | |
190 } | |
191 const GURL& data_url() const { | |
192 return data_url_; | |
193 } | |
194 void set_data_url(const GURL& data_url) { | |
195 data_url_ = data_url; | |
196 } | |
197 | |
184 // Record the nature of this load, for use when histogramming page load times. | 198 // Record the nature of this load, for use when histogramming page load times. |
185 LoadType load_type() const { return load_type_; } | 199 LoadType load_type() const { return load_type_; } |
186 void set_load_type(LoadType load_type) { load_type_ = load_type; } | 200 void set_load_type(LoadType load_type) { load_type_ = load_type; } |
187 | 201 |
188 NavigationState* navigation_state() { return navigation_state_.get(); } | 202 NavigationState* navigation_state() { return navigation_state_.get(); } |
189 void set_navigation_state(NavigationState* navigation_state); | 203 void set_navigation_state(NavigationState* navigation_state); |
190 | 204 |
191 bool can_load_local_resources() const { return can_load_local_resources_; } | 205 bool can_load_local_resources() const { return can_load_local_resources_; } |
192 void set_can_load_local_resources(bool can_load) { | 206 void set_can_load_local_resources(bool can_load) { |
193 can_load_local_resources_ = can_load; | 207 can_load_local_resources_ = can_load; |
(...skipping 14 matching lines...) Expand all Loading... | |
208 std::string npn_negotiated_protocol_; | 222 std::string npn_negotiated_protocol_; |
209 bool was_alternate_protocol_available_; | 223 bool was_alternate_protocol_available_; |
210 net::HttpResponseInfo::ConnectionInfo connection_info_; | 224 net::HttpResponseInfo::ConnectionInfo connection_info_; |
211 bool was_fetched_via_proxy_; | 225 bool was_fetched_via_proxy_; |
212 net::HostPortPair proxy_server_; | 226 net::HostPortPair proxy_server_; |
213 | 227 |
214 // A prefetcher is a page that contains link rel=prefetch elements. | 228 // A prefetcher is a page that contains link rel=prefetch elements. |
215 bool was_prefetcher_; | 229 bool was_prefetcher_; |
216 bool was_referred_by_prefetcher_; | 230 bool was_referred_by_prefetcher_; |
217 bool was_after_preconnect_request_; | 231 bool was_after_preconnect_request_; |
232 bool was_load_data_with_base_url_request_; | |
Charlie Reis
2015/11/24 00:22:59
nit: Place these two in their own block with a com
boliu
2015/11/24 19:03:25
Done.
| |
233 GURL data_url_; | |
218 | 234 |
219 LoadType load_type_; | 235 LoadType load_type_; |
220 | 236 |
221 scoped_ptr<NavigationState> navigation_state_; | 237 scoped_ptr<NavigationState> navigation_state_; |
222 | 238 |
223 bool can_load_local_resources_; | 239 bool can_load_local_resources_; |
224 }; | 240 }; |
225 | 241 |
226 #endif // CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ | 242 #endif // CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ |
227 | 243 |
228 } // namespace content | 244 } // namespace content |
OLD | NEW |