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