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_CHILD_REQUEST_EXTRA_DATA_H_ | 5 #ifndef CONTENT_CHILD_REQUEST_EXTRA_DATA_H_ |
6 #define CONTENT_CHILD_REQUEST_EXTRA_DATA_H_ | 6 #define CONTENT_CHILD_REQUEST_EXTRA_DATA_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "content/child/web_url_loader_impl.h" | 12 #include "content/child/web_url_loader_impl.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "content/common/navigation_params.h" | 14 #include "content/common/navigation_params.h" |
15 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 15 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
16 #include "third_party/WebKit/public/platform/WebString.h" | 16 #include "third_party/WebKit/public/platform/WebString.h" |
17 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 17 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
18 #include "ui/base/page_transition_types.h" | 18 #include "ui/base/page_transition_types.h" |
| 19 #include "url/origin.h" |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 | 22 |
22 struct ResourceRequest; | 23 struct ResourceRequest; |
23 | 24 |
24 // Can be used by callers to store extra data on every ResourceRequest | 25 // Can be used by callers to store extra data on every ResourceRequest |
25 // which will be incorporated into the ResourceHostMsg_RequestResource message | 26 // which will be incorporated into the ResourceHostMsg_RequestResource message |
26 // sent by ResourceDispatcher. | 27 // sent by ResourceDispatcher. |
27 class CONTENT_EXPORT RequestExtraData | 28 class CONTENT_EXPORT RequestExtraData |
28 : public NON_EXPORTED_BASE(blink::WebURLRequest::ExtraData) { | 29 : public NON_EXPORTED_BASE(blink::WebURLRequest::ExtraData) { |
29 public: | 30 public: |
30 RequestExtraData(); | 31 RequestExtraData(); |
31 ~RequestExtraData() override; | 32 ~RequestExtraData() override; |
32 | 33 |
33 blink::WebPageVisibilityState visibility_state() const { | 34 blink::WebPageVisibilityState visibility_state() const { |
34 return visibility_state_; | 35 return visibility_state_; |
35 } | 36 } |
36 void set_visibility_state(blink::WebPageVisibilityState visibility_state) { | 37 void set_visibility_state(blink::WebPageVisibilityState visibility_state) { |
37 visibility_state_ = visibility_state; | 38 visibility_state_ = visibility_state; |
38 } | 39 } |
39 int render_frame_id() const { return render_frame_id_; } | 40 int render_frame_id() const { return render_frame_id_; } |
40 void set_render_frame_id(int render_frame_id) { | 41 void set_render_frame_id(int render_frame_id) { |
41 render_frame_id_ = render_frame_id; | 42 render_frame_id_ = render_frame_id; |
42 } | 43 } |
43 bool is_main_frame() const { return is_main_frame_; } | 44 bool is_main_frame() const { return is_main_frame_; } |
44 void set_is_main_frame(bool is_main_frame) { | 45 void set_is_main_frame(bool is_main_frame) { |
45 is_main_frame_ = is_main_frame; | 46 is_main_frame_ = is_main_frame; |
46 } | 47 } |
47 GURL frame_origin() const { return frame_origin_; } | 48 url::Origin frame_origin() const { return frame_origin_; } |
48 void set_frame_origin(const GURL& frame_origin) { | 49 void set_frame_origin(const url::Origin& frame_origin) { |
49 frame_origin_ = frame_origin; | 50 frame_origin_ = frame_origin; |
50 } | 51 } |
51 bool parent_is_main_frame() const { return parent_is_main_frame_; } | 52 bool parent_is_main_frame() const { return parent_is_main_frame_; } |
52 void set_parent_is_main_frame(bool parent_is_main_frame) { | 53 void set_parent_is_main_frame(bool parent_is_main_frame) { |
53 parent_is_main_frame_ = parent_is_main_frame; | 54 parent_is_main_frame_ = parent_is_main_frame; |
54 } | 55 } |
55 int parent_render_frame_id() const { return parent_render_frame_id_; } | 56 int parent_render_frame_id() const { return parent_render_frame_id_; } |
56 void set_parent_render_frame_id(int parent_render_frame_id) { | 57 void set_parent_render_frame_id(int parent_render_frame_id) { |
57 parent_render_frame_id_ = parent_render_frame_id; | 58 parent_render_frame_id_ = parent_render_frame_id; |
58 } | 59 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void set_download_to_network_cache_only(bool download_to_cache) { | 148 void set_download_to_network_cache_only(bool download_to_cache) { |
148 download_to_network_cache_only_ = download_to_cache; | 149 download_to_network_cache_only_ = download_to_cache; |
149 } | 150 } |
150 | 151 |
151 void CopyToResourceRequest(ResourceRequest* request) const; | 152 void CopyToResourceRequest(ResourceRequest* request) const; |
152 | 153 |
153 private: | 154 private: |
154 blink::WebPageVisibilityState visibility_state_; | 155 blink::WebPageVisibilityState visibility_state_; |
155 int render_frame_id_; | 156 int render_frame_id_; |
156 bool is_main_frame_; | 157 bool is_main_frame_; |
157 GURL frame_origin_; | 158 url::Origin frame_origin_; |
158 bool parent_is_main_frame_; | 159 bool parent_is_main_frame_; |
159 int parent_render_frame_id_; | 160 int parent_render_frame_id_; |
160 bool allow_download_; | 161 bool allow_download_; |
161 ui::PageTransition transition_type_; | 162 ui::PageTransition transition_type_; |
162 bool should_replace_current_entry_; | 163 bool should_replace_current_entry_; |
163 int transferred_request_child_id_; | 164 int transferred_request_child_id_; |
164 int transferred_request_request_id_; | 165 int transferred_request_request_id_; |
165 int service_worker_provider_id_; | 166 int service_worker_provider_id_; |
166 bool originated_from_service_worker_; | 167 bool originated_from_service_worker_; |
167 blink::WebString custom_user_agent_; | 168 blink::WebString custom_user_agent_; |
168 blink::WebString requested_with_; | 169 blink::WebString requested_with_; |
169 std::unique_ptr<StreamOverrideParameters> stream_override_; | 170 std::unique_ptr<StreamOverrideParameters> stream_override_; |
170 bool initiated_in_secure_context_; | 171 bool initiated_in_secure_context_; |
171 bool is_prefetch_; | 172 bool is_prefetch_; |
172 bool download_to_network_cache_only_; | 173 bool download_to_network_cache_only_; |
173 | 174 |
174 DISALLOW_COPY_AND_ASSIGN(RequestExtraData); | 175 DISALLOW_COPY_AND_ASSIGN(RequestExtraData); |
175 }; | 176 }; |
176 | 177 |
177 } // namespace content | 178 } // namespace content |
178 | 179 |
179 #endif // CONTENT_CHILD_REQUEST_EXTRA_DATA_H_ | 180 #endif // CONTENT_CHILD_REQUEST_EXTRA_DATA_H_ |
OLD | NEW |