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 25 matching lines...) Expand all Loading... |
36 SourceLocation::~SourceLocation() {} | 36 SourceLocation::~SourceLocation() {} |
37 | 37 |
38 CommonNavigationParams::CommonNavigationParams() | 38 CommonNavigationParams::CommonNavigationParams() |
39 : transition(ui::PAGE_TRANSITION_LINK), | 39 : transition(ui::PAGE_TRANSITION_LINK), |
40 navigation_type(FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT), | 40 navigation_type(FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT), |
41 allow_download(true), | 41 allow_download(true), |
42 should_replace_current_entry(false), | 42 should_replace_current_entry(false), |
43 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT), | 43 report_type(FrameMsg_UILoadMetricsReportType::NO_REPORT), |
44 previews_state(PREVIEWS_UNSPECIFIED), | 44 previews_state(PREVIEWS_UNSPECIFIED), |
45 navigation_start(base::TimeTicks::Now()), | 45 navigation_start(base::TimeTicks::Now()), |
46 method("GET") {} | 46 method("GET"), |
| 47 should_check_main_world_csp(CSPDisposition::CHECK) {} |
47 | 48 |
48 CommonNavigationParams::CommonNavigationParams( | 49 CommonNavigationParams::CommonNavigationParams( |
49 const GURL& url, | 50 const GURL& url, |
50 const Referrer& referrer, | 51 const Referrer& referrer, |
51 ui::PageTransition transition, | 52 ui::PageTransition transition, |
52 FrameMsg_Navigate_Type::Value navigation_type, | 53 FrameMsg_Navigate_Type::Value navigation_type, |
53 bool allow_download, | 54 bool allow_download, |
54 bool should_replace_current_entry, | 55 bool should_replace_current_entry, |
55 base::TimeTicks ui_timestamp, | 56 base::TimeTicks ui_timestamp, |
56 FrameMsg_UILoadMetricsReportType::Value report_type, | 57 FrameMsg_UILoadMetricsReportType::Value report_type, |
57 const GURL& base_url_for_data_url, | 58 const GURL& base_url_for_data_url, |
58 const GURL& history_url_for_data_url, | 59 const GURL& history_url_for_data_url, |
59 PreviewsState previews_state, | 60 PreviewsState previews_state, |
60 const base::TimeTicks& navigation_start, | 61 const base::TimeTicks& navigation_start, |
61 std::string method, | 62 std::string method, |
62 const scoped_refptr<ResourceRequestBodyImpl>& post_data, | 63 const scoped_refptr<ResourceRequestBodyImpl>& post_data, |
63 base::Optional<SourceLocation> source_location) | 64 base::Optional<SourceLocation> source_location, |
| 65 CSPDisposition should_check_main_world_csp) |
64 : url(url), | 66 : url(url), |
65 referrer(referrer), | 67 referrer(referrer), |
66 transition(transition), | 68 transition(transition), |
67 navigation_type(navigation_type), | 69 navigation_type(navigation_type), |
68 allow_download(allow_download), | 70 allow_download(allow_download), |
69 should_replace_current_entry(should_replace_current_entry), | 71 should_replace_current_entry(should_replace_current_entry), |
70 ui_timestamp(ui_timestamp), | 72 ui_timestamp(ui_timestamp), |
71 report_type(report_type), | 73 report_type(report_type), |
72 base_url_for_data_url(base_url_for_data_url), | 74 base_url_for_data_url(base_url_for_data_url), |
73 history_url_for_data_url(history_url_for_data_url), | 75 history_url_for_data_url(history_url_for_data_url), |
74 previews_state(previews_state), | 76 previews_state(previews_state), |
75 navigation_start(navigation_start), | 77 navigation_start(navigation_start), |
76 method(method), | 78 method(method), |
77 post_data(post_data), | 79 post_data(post_data), |
78 source_location(source_location) { | 80 source_location(source_location), |
| 81 should_check_main_world_csp(should_check_main_world_csp) { |
79 // |method != "POST"| should imply absence of |post_data|. | 82 // |method != "POST"| should imply absence of |post_data|. |
80 if (method != "POST" && post_data) { | 83 if (method != "POST" && post_data) { |
81 NOTREACHED(); | 84 NOTREACHED(); |
82 this->post_data = nullptr; | 85 this->post_data = nullptr; |
83 } | 86 } |
84 } | 87 } |
85 | 88 |
86 CommonNavigationParams::CommonNavigationParams( | 89 CommonNavigationParams::CommonNavigationParams( |
87 const CommonNavigationParams& other) = default; | 90 const CommonNavigationParams& other) = default; |
88 | 91 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 const RequestNavigationParams& request_params) | 210 const RequestNavigationParams& request_params) |
208 : common_params(common_params), | 211 : common_params(common_params), |
209 start_params(start_params), | 212 start_params(start_params), |
210 request_params(request_params) { | 213 request_params(request_params) { |
211 } | 214 } |
212 | 215 |
213 NavigationParams::~NavigationParams() { | 216 NavigationParams::~NavigationParams() { |
214 } | 217 } |
215 | 218 |
216 } // namespace content | 219 } // namespace content |
OLD | NEW |