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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ref_counted_memory.h" | 8 #include "content/common/content_constants_internal.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/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 // PlzNavigate | 14 // PlzNavigate |
15 bool ShouldMakeNetworkRequestForURL(const GURL& url) { | 15 bool ShouldMakeNetworkRequestForURL(const GURL& url) { |
16 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 16 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
17 switches::kEnableBrowserSideNavigation)); | 17 switches::kEnableBrowserSideNavigation)); |
18 | 18 |
(...skipping 19 matching lines...) Expand all Loading... |
38 const GURL& url, | 38 const GURL& url, |
39 const Referrer& referrer, | 39 const Referrer& referrer, |
40 ui::PageTransition transition, | 40 ui::PageTransition transition, |
41 FrameMsg_Navigate_Type::Value navigation_type, | 41 FrameMsg_Navigate_Type::Value navigation_type, |
42 bool allow_download, | 42 bool allow_download, |
43 bool should_replace_current_entry, | 43 bool should_replace_current_entry, |
44 base::TimeTicks ui_timestamp, | 44 base::TimeTicks ui_timestamp, |
45 FrameMsg_UILoadMetricsReportType::Value report_type, | 45 FrameMsg_UILoadMetricsReportType::Value report_type, |
46 const GURL& base_url_for_data_url, | 46 const GURL& base_url_for_data_url, |
47 const GURL& history_url_for_data_url, | 47 const GURL& history_url_for_data_url, |
| 48 const std::string& data_url_as_string, |
48 LoFiState lofi_state, | 49 LoFiState lofi_state, |
49 const base::TimeTicks& navigation_start) | 50 const base::TimeTicks& navigation_start) |
50 : url(url), | 51 : url(url), |
51 referrer(referrer), | 52 referrer(referrer), |
52 transition(transition), | 53 transition(transition), |
53 navigation_type(navigation_type), | 54 navigation_type(navigation_type), |
54 allow_download(allow_download), | 55 allow_download(allow_download), |
55 should_replace_current_entry(should_replace_current_entry), | 56 should_replace_current_entry(should_replace_current_entry), |
56 ui_timestamp(ui_timestamp), | 57 ui_timestamp(ui_timestamp), |
57 report_type(report_type), | 58 report_type(report_type), |
58 base_url_for_data_url(base_url_for_data_url), | 59 base_url_for_data_url(base_url_for_data_url), |
59 history_url_for_data_url(history_url_for_data_url), | 60 history_url_for_data_url(history_url_for_data_url), |
| 61 data_url_as_string(data_url_as_string), |
60 lofi_state(lofi_state), | 62 lofi_state(lofi_state), |
61 navigation_start(navigation_start) { | 63 navigation_start(navigation_start) { |
| 64 if (data_url_as_string.length() > kMaxLengthOfDataURLString) |
| 65 this->data_url_as_string = std::string(); |
62 } | 66 } |
63 | 67 |
64 CommonNavigationParams::~CommonNavigationParams() { | 68 CommonNavigationParams::~CommonNavigationParams() { |
65 } | 69 } |
66 | 70 |
67 BeginNavigationParams::BeginNavigationParams() | 71 BeginNavigationParams::BeginNavigationParams() |
68 : load_flags(0), | 72 : load_flags(0), |
69 has_user_gesture(false), | 73 has_user_gesture(false), |
70 skip_service_worker(false), | 74 skip_service_worker(false), |
71 request_context_type(REQUEST_CONTEXT_TYPE_LOCATION) {} | 75 request_context_type(REQUEST_CONTEXT_TYPE_LOCATION) {} |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const RequestNavigationParams& request_params) | 179 const RequestNavigationParams& request_params) |
176 : common_params(common_params), | 180 : common_params(common_params), |
177 start_params(start_params), | 181 start_params(start_params), |
178 request_params(request_params) { | 182 request_params(request_params) { |
179 } | 183 } |
180 | 184 |
181 NavigationParams::~NavigationParams() { | 185 NavigationParams::~NavigationParams() { |
182 } | 186 } |
183 | 187 |
184 } // namespace content | 188 } // namespace content |
OLD | NEW |