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

Side by Side Diff: content/browser/service_worker/service_worker_fetch_dispatcher.cc

Issue 2446553002: Support Service Worker NavigationPreload with PlzNavigate. (Closed)
Patch Set: remove unnecessary comment Created 4 years, 1 month 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/browser/service_worker/service_worker_fetch_dispatcher.h" 5 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 return; 289 return;
290 // TODO(horo): Currently NavigationPreload doesn't support request body. 290 // TODO(horo): Currently NavigationPreload doesn't support request body.
291 if (!request_->blob_uuid.empty()) 291 if (!request_->blob_uuid.empty())
292 return; 292 return;
293 if (!base::FeatureList::IsEnabled( 293 if (!base::FeatureList::IsEnabled(
294 features::kServiceWorkerNavigationPreload)) { 294 features::kServiceWorkerNavigationPreload)) {
295 // TODO(horo): Check |version_|'s origin_trial_tokens() here if we use 295 // TODO(horo): Check |version_|'s origin_trial_tokens() here if we use
296 // Origin-Trial for NavigationPreload. 296 // Origin-Trial for NavigationPreload.
297 return; 297 return;
298 } 298 }
299 if (IsBrowserSideNavigationEnabled()) {
300 // TODO(horo): Support NavigationPreload with PlzNavigate.
301 NOTIMPLEMENTED();
302 return;
303 }
304 DCHECK(!url_loader_factory_getter.is_null()); 299 DCHECK(!url_loader_factory_getter.is_null());
305 mojom::URLLoaderFactoryPtr factory; 300 mojom::URLLoaderFactoryPtr factory;
306 url_loader_factory_getter.Run(mojo::GetProxy(&factory)); 301 url_loader_factory_getter.Run(mojo::GetProxy(&factory));
307 if (url_loader_factory_getter.IsCancelled()) 302 if (url_loader_factory_getter.IsCancelled())
308 return; 303 return;
309 304
310 preload_handle_ = mojom::FetchEventPreloadHandle::New(); 305 preload_handle_ = mojom::FetchEventPreloadHandle::New();
311 const ResourceRequestInfoImpl* original_info = 306 const ResourceRequestInfoImpl* original_info =
312 ResourceRequestInfoImpl::ForRequest(original_request); 307 ResourceRequestInfoImpl::ForRequest(original_request);
313 308
(...skipping 26 matching lines...) Expand all
340 } 335 }
341 336
342 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 337 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
343 const { 338 const {
344 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 339 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
345 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 340 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
346 return ResourceTypeToEventType(resource_type_); 341 return ResourceTypeToEventType(resource_type_);
347 } 342 }
348 343
349 } // namespace content 344 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698