OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ | 5 #ifndef CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ |
6 #define CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ | 6 #define CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/supports_user_data.h" | 12 #include "base/supports_user_data.h" |
13 #include "third_party/WebKit/public/platform/WebCachePolicy.h" | 13 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 class WebDataSource; | 17 class WebDataSource; |
18 enum class WebCachePolicy; | 18 enum class WebCachePolicy; |
19 } | 19 } |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class DocumentState; | 23 class DocumentState; |
24 | 24 |
25 // Stores internal state per WebDataSource. | 25 // Stores internal state per WebDataSource. |
26 class InternalDocumentStateData : public base::SupportsUserData::Data { | 26 class InternalDocumentStateData : public base::SupportsUserData::Data { |
27 public: | 27 public: |
28 InternalDocumentStateData(); | 28 InternalDocumentStateData(); |
| 29 ~InternalDocumentStateData() override; |
29 | 30 |
30 static InternalDocumentStateData* FromDataSource(blink::WebDataSource* ds); | 31 static InternalDocumentStateData* FromDataSource(blink::WebDataSource* ds); |
31 static InternalDocumentStateData* FromDocumentState(DocumentState* ds); | 32 static InternalDocumentStateData* FromDocumentState(DocumentState* ds); |
32 | 33 |
33 int http_status_code() const { return http_status_code_; } | 34 int http_status_code() const { return http_status_code_; } |
34 void set_http_status_code(int http_status_code) { | 35 void set_http_status_code(int http_status_code) { |
35 http_status_code_ = http_status_code; | 36 http_status_code_ = http_status_code; |
36 } | 37 } |
37 | 38 |
38 const GURL& searchable_form_url() const { return searchable_form_url_; } | 39 const GURL& searchable_form_url() const { return searchable_form_url_; } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return cache_policy_override_; | 71 return cache_policy_override_; |
71 } | 72 } |
72 void clear_cache_policy_override() { | 73 void clear_cache_policy_override() { |
73 cache_policy_override_set_ = false; | 74 cache_policy_override_set_ = false; |
74 cache_policy_override_ = blink::WebCachePolicy::kUseProtocolCachePolicy; | 75 cache_policy_override_ = blink::WebCachePolicy::kUseProtocolCachePolicy; |
75 } | 76 } |
76 bool is_cache_policy_override_set() const { | 77 bool is_cache_policy_override_set() const { |
77 return cache_policy_override_set_; | 78 return cache_policy_override_set_; |
78 } | 79 } |
79 | 80 |
80 protected: | |
81 ~InternalDocumentStateData() override; | |
82 | |
83 private: | 81 private: |
84 int http_status_code_; | 82 int http_status_code_; |
85 GURL searchable_form_url_; | 83 GURL searchable_form_url_; |
86 std::string searchable_form_encoding_; | 84 std::string searchable_form_encoding_; |
87 bool is_overriding_user_agent_; | 85 bool is_overriding_user_agent_; |
88 bool must_reset_scroll_and_scale_state_; | 86 bool must_reset_scroll_and_scale_state_; |
89 bool cache_policy_override_set_; | 87 bool cache_policy_override_set_; |
90 blink::WebCachePolicy cache_policy_override_; | 88 blink::WebCachePolicy cache_policy_override_; |
91 | 89 |
92 DISALLOW_COPY_AND_ASSIGN(InternalDocumentStateData); | 90 DISALLOW_COPY_AND_ASSIGN(InternalDocumentStateData); |
93 }; | 91 }; |
94 | 92 |
95 } // namespace content | 93 } // namespace content |
96 | 94 |
97 #endif // CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ | 95 #endif // CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ |
OLD | NEW |