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 "build/build_config.h" | 8 #include "build/build_config.h" |
8 #include "content/common/service_worker/service_worker_types.h" | 9 #include "content/common/service_worker/service_worker_types.h" |
9 #include "content/public/common/browser_side_navigation_policy.h" | 10 #include "content/public/common/browser_side_navigation_policy.h" |
10 #include "content/public/common/url_constants.h" | 11 #include "content/public/common/url_constants.h" |
| 12 #include "url/gurl.h" |
| 13 #include "url/url_constants.h" |
11 | 14 |
12 namespace content { | 15 namespace content { |
13 | 16 |
14 // PlzNavigate | 17 // PlzNavigate |
15 bool ShouldMakeNetworkRequestForURL(const GURL& url) { | 18 bool ShouldMakeNetworkRequestForURL(const GURL& url) { |
16 CHECK(IsBrowserSideNavigationEnabled()); | 19 CHECK(IsBrowserSideNavigationEnabled()); |
17 | 20 |
18 // Data URLs, Javascript URLs, about:blank, srcdoc should not send a request | 21 // Data URLs, Javascript URLs, about:blank, srcdoc should not send a request |
19 // to the network stack. | 22 // to the network stack. |
20 // TODO(clamy): same document navigations should not send requests to the | 23 // TODO(clamy): same document navigations should not send requests to the |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 navigation_type(navigation_type), | 58 navigation_type(navigation_type), |
56 allow_download(allow_download), | 59 allow_download(allow_download), |
57 should_replace_current_entry(should_replace_current_entry), | 60 should_replace_current_entry(should_replace_current_entry), |
58 ui_timestamp(ui_timestamp), | 61 ui_timestamp(ui_timestamp), |
59 report_type(report_type), | 62 report_type(report_type), |
60 base_url_for_data_url(base_url_for_data_url), | 63 base_url_for_data_url(base_url_for_data_url), |
61 history_url_for_data_url(history_url_for_data_url), | 64 history_url_for_data_url(history_url_for_data_url), |
62 lofi_state(lofi_state), | 65 lofi_state(lofi_state), |
63 navigation_start(navigation_start), | 66 navigation_start(navigation_start), |
64 method(method), | 67 method(method), |
65 post_data(post_data) {} | 68 post_data(post_data) { |
| 69 // |method != "POST"| should imply absence of |post_data|. |
| 70 if (method != "POST" && post_data) { |
| 71 NOTREACHED(); |
| 72 this->post_data = nullptr; |
| 73 } |
| 74 } |
66 | 75 |
67 CommonNavigationParams::CommonNavigationParams( | 76 CommonNavigationParams::CommonNavigationParams( |
68 const CommonNavigationParams& other) = default; | 77 const CommonNavigationParams& other) = default; |
69 | 78 |
70 CommonNavigationParams::~CommonNavigationParams() { | 79 CommonNavigationParams::~CommonNavigationParams() { |
71 } | 80 } |
72 | 81 |
73 BeginNavigationParams::BeginNavigationParams() | 82 BeginNavigationParams::BeginNavigationParams() |
74 : load_flags(0), | 83 : load_flags(0), |
75 has_user_gesture(false), | 84 has_user_gesture(false), |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 const RequestNavigationParams& request_params) | 193 const RequestNavigationParams& request_params) |
185 : common_params(common_params), | 194 : common_params(common_params), |
186 start_params(start_params), | 195 start_params(start_params), |
187 request_params(request_params) { | 196 request_params(request_params) { |
188 } | 197 } |
189 | 198 |
190 NavigationParams::~NavigationParams() { | 199 NavigationParams::~NavigationParams() { |
191 } | 200 } |
192 | 201 |
193 } // namespace content | 202 } // namespace content |
OLD | NEW |