Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: content/common/navigation_params.cc

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/memory/ref_counted_memory.h"
9 #include "content/common/service_worker/service_worker_types.h"
9 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
10 11
11 namespace content { 12 namespace content {
12 13
13 // PlzNavigate 14 // PlzNavigate
14 bool ShouldMakeNetworkRequestForURL(const GURL& url) { 15 bool ShouldMakeNetworkRequestForURL(const GURL& url) {
15 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 16 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
16 switches::kEnableBrowserSideNavigation)); 17 switches::kEnableBrowserSideNavigation));
17 18
18 // Data URLs, Javascript URLs and about:blank should not send a request to the 19 // Data URLs, Javascript URLs and about:blank should not send a request to the
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ui_timestamp(ui_timestamp), 52 ui_timestamp(ui_timestamp),
52 report_type(report_type), 53 report_type(report_type),
53 base_url_for_data_url(base_url_for_data_url), 54 base_url_for_data_url(base_url_for_data_url),
54 history_url_for_data_url(history_url_for_data_url) { 55 history_url_for_data_url(history_url_for_data_url) {
55 } 56 }
56 57
57 CommonNavigationParams::~CommonNavigationParams() { 58 CommonNavigationParams::~CommonNavigationParams() {
58 } 59 }
59 60
60 BeginNavigationParams::BeginNavigationParams() 61 BeginNavigationParams::BeginNavigationParams()
61 : load_flags(0), has_user_gesture(false) { 62 : load_flags(0),
62 } 63 has_user_gesture(false),
64 skip_service_worker(false),
65 request_context_type(REQUEST_CONTEXT_TYPE_HYPERLINK) {}
nasko 2015/10/02 22:09:45 Did we confirm the current code uses hyperlink or
Fabrice (no longer in Chrome) 2015/10/06 17:21:38 Done in the other patch.
63 66
64 BeginNavigationParams::BeginNavigationParams(std::string method, 67 BeginNavigationParams::BeginNavigationParams(
65 std::string headers, 68 std::string method,
66 int load_flags, 69 std::string headers,
67 bool has_user_gesture) 70 int load_flags,
71 bool has_user_gesture,
72 bool skip_service_worker,
73 RequestContextType request_context_type)
68 : method(method), 74 : method(method),
69 headers(headers), 75 headers(headers),
70 load_flags(load_flags), 76 load_flags(load_flags),
71 has_user_gesture(has_user_gesture) { 77 has_user_gesture(has_user_gesture),
72 } 78 skip_service_worker(skip_service_worker),
79 request_context_type(request_context_type) {}
73 80
74 StartNavigationParams::StartNavigationParams() 81 StartNavigationParams::StartNavigationParams()
75 : is_post(false), 82 : is_post(false),
76 #if defined(OS_ANDROID) 83 #if defined(OS_ANDROID)
77 has_user_gesture(false), 84 has_user_gesture(false),
78 #endif 85 #endif
79 transferred_request_child_id(-1), 86 transferred_request_child_id(-1),
80 transferred_request_request_id(-1) { 87 transferred_request_request_id(-1) {
81 } 88 }
82 89
(...skipping 25 matching lines...) Expand all
108 can_load_local_resources(false), 115 can_load_local_resources(false),
109 request_time(base::Time::Now()), 116 request_time(base::Time::Now()),
110 page_id(-1), 117 page_id(-1),
111 nav_entry_id(0), 118 nav_entry_id(0),
112 is_same_document_history_load(false), 119 is_same_document_history_load(false),
113 has_committed_real_load(false), 120 has_committed_real_load(false),
114 intended_as_new_entry(false), 121 intended_as_new_entry(false),
115 pending_history_list_offset(-1), 122 pending_history_list_offset(-1),
116 current_history_list_offset(-1), 123 current_history_list_offset(-1),
117 current_history_list_length(0), 124 current_history_list_length(0),
118 should_clear_history_list(false) { 125 should_clear_history_list(false),
119 } 126 service_worker_provider_id(kInvalidServiceWorkerProviderId) {}
120 127
121 RequestNavigationParams::RequestNavigationParams( 128 RequestNavigationParams::RequestNavigationParams(
122 bool is_overriding_user_agent, 129 bool is_overriding_user_agent,
123 base::TimeTicks navigation_start, 130 base::TimeTicks navigation_start,
124 const std::vector<GURL>& redirects, 131 const std::vector<GURL>& redirects,
125 bool can_load_local_resources, 132 bool can_load_local_resources,
126 base::Time request_time, 133 base::Time request_time,
127 const PageState& page_state, 134 const PageState& page_state,
128 int32 page_id, 135 int32 page_id,
129 int nav_entry_id, 136 int nav_entry_id,
(...skipping 11 matching lines...) Expand all
141 request_time(request_time), 148 request_time(request_time),
142 page_state(page_state), 149 page_state(page_state),
143 page_id(page_id), 150 page_id(page_id),
144 nav_entry_id(nav_entry_id), 151 nav_entry_id(nav_entry_id),
145 is_same_document_history_load(is_same_document_history_load), 152 is_same_document_history_load(is_same_document_history_load),
146 has_committed_real_load(has_committed_real_load), 153 has_committed_real_load(has_committed_real_load),
147 intended_as_new_entry(intended_as_new_entry), 154 intended_as_new_entry(intended_as_new_entry),
148 pending_history_list_offset(pending_history_list_offset), 155 pending_history_list_offset(pending_history_list_offset),
149 current_history_list_offset(current_history_list_offset), 156 current_history_list_offset(current_history_list_offset),
150 current_history_list_length(current_history_list_length), 157 current_history_list_length(current_history_list_length),
151 should_clear_history_list(should_clear_history_list) { 158 should_clear_history_list(should_clear_history_list),
152 } 159 service_worker_provider_id(kInvalidServiceWorkerProviderId) {}
153 160
154 RequestNavigationParams::~RequestNavigationParams() { 161 RequestNavigationParams::~RequestNavigationParams() {
155 } 162 }
156 163
157 NavigationParams::NavigationParams( 164 NavigationParams::NavigationParams(
158 const CommonNavigationParams& common_params, 165 const CommonNavigationParams& common_params,
159 const StartNavigationParams& start_params, 166 const StartNavigationParams& start_params,
160 const RequestNavigationParams& request_params) 167 const RequestNavigationParams& request_params)
161 : common_params(common_params), 168 : common_params(common_params),
162 start_params(start_params), 169 start_params(start_params),
163 request_params(request_params) { 170 request_params(request_params) {
164 } 171 }
165 172
166 NavigationParams::~NavigationParams() { 173 NavigationParams::~NavigationParams() {
167 } 174 }
168 175
169 } // namespace content 176 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698