OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/common/navigation_params.h" | 5 #include "content/common/navigation_params.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/common/service_worker/service_worker_types.h" | 9 #include "content/common/service_worker/service_worker_types.h" |
10 #include "content/public/common/appcache_info.h" | 10 #include "content/public/common/appcache_info.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 CommonNavigationParams::CommonNavigationParams() | 29 CommonNavigationParams::CommonNavigationParams() |
30 : transition(ui::PAGE_TRANSITION_LINK), | 30 : transition(ui::PAGE_TRANSITION_LINK), |
31 navigation_type(FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT), | 31 navigation_type(FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT), |
32 allow_download(true), | 32 allow_download(true), |
33 should_replace_current_entry(false), | 33 should_replace_current_entry(false), |
34 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT), | 34 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT), |
35 previews_state(PREVIEWS_UNSPECIFIED), | 35 previews_state(PREVIEWS_UNSPECIFIED), |
36 navigation_start(base::TimeTicks::Now()), | 36 navigation_start(base::TimeTicks::Now()), |
37 method("GET") {} | 37 method("GET"), |
| 38 should_bypass_main_world_csp(false) {} |
38 | 39 |
39 CommonNavigationParams::CommonNavigationParams( | 40 CommonNavigationParams::CommonNavigationParams( |
40 const GURL& url, | 41 const GURL& url, |
41 const Referrer& referrer, | 42 const Referrer& referrer, |
42 ui::PageTransition transition, | 43 ui::PageTransition transition, |
43 FrameMsg_Navigate_Type::Value navigation_type, | 44 FrameMsg_Navigate_Type::Value navigation_type, |
44 bool allow_download, | 45 bool allow_download, |
45 bool should_replace_current_entry, | 46 bool should_replace_current_entry, |
46 base::TimeTicks ui_timestamp, | 47 base::TimeTicks ui_timestamp, |
47 FrameMsg_UILoadMetricsReportType::Value report_type, | 48 FrameMsg_UILoadMetricsReportType::Value report_type, |
48 const GURL& base_url_for_data_url, | 49 const GURL& base_url_for_data_url, |
49 const GURL& history_url_for_data_url, | 50 const GURL& history_url_for_data_url, |
50 PreviewsState previews_state, | 51 PreviewsState previews_state, |
51 const base::TimeTicks& navigation_start, | 52 const base::TimeTicks& navigation_start, |
52 std::string method, | 53 std::string method, |
53 const scoped_refptr<ResourceRequestBodyImpl>& post_data) | 54 const scoped_refptr<ResourceRequestBodyImpl>& post_data, |
| 55 bool should_bypass_main_world_csp) |
54 : url(url), | 56 : url(url), |
55 referrer(referrer), | 57 referrer(referrer), |
56 transition(transition), | 58 transition(transition), |
57 navigation_type(navigation_type), | 59 navigation_type(navigation_type), |
58 allow_download(allow_download), | 60 allow_download(allow_download), |
59 should_replace_current_entry(should_replace_current_entry), | 61 should_replace_current_entry(should_replace_current_entry), |
60 ui_timestamp(ui_timestamp), | 62 ui_timestamp(ui_timestamp), |
61 report_type(report_type), | 63 report_type(report_type), |
62 base_url_for_data_url(base_url_for_data_url), | 64 base_url_for_data_url(base_url_for_data_url), |
63 history_url_for_data_url(history_url_for_data_url), | 65 history_url_for_data_url(history_url_for_data_url), |
64 previews_state(previews_state), | 66 previews_state(previews_state), |
65 navigation_start(navigation_start), | 67 navigation_start(navigation_start), |
66 method(method), | 68 method(method), |
67 post_data(post_data) { | 69 post_data(post_data), |
| 70 should_bypass_main_world_csp(should_bypass_main_world_csp) { |
68 // |method != "POST"| should imply absence of |post_data|. | 71 // |method != "POST"| should imply absence of |post_data|. |
69 if (method != "POST" && post_data) { | 72 if (method != "POST" && post_data) { |
70 NOTREACHED(); | 73 NOTREACHED(); |
71 this->post_data = nullptr; | 74 this->post_data = nullptr; |
72 } | 75 } |
73 } | 76 } |
74 | 77 |
75 CommonNavigationParams::CommonNavigationParams( | 78 CommonNavigationParams::CommonNavigationParams( |
76 const CommonNavigationParams& other) = default; | 79 const CommonNavigationParams& other) = default; |
77 | 80 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 const RequestNavigationParams& request_params) | 199 const RequestNavigationParams& request_params) |
197 : common_params(common_params), | 200 : common_params(common_params), |
198 start_params(start_params), | 201 start_params(start_params), |
199 request_params(request_params) { | 202 request_params(request_params) { |
200 } | 203 } |
201 | 204 |
202 NavigationParams::~NavigationParams() { | 205 NavigationParams::~NavigationParams() { |
203 } | 206 } |
204 | 207 |
205 } // namespace content | 208 } // namespace content |
OLD | NEW |