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

Side by Side Diff: content/browser/loader/navigation_url_loader.cc

Issue 2045383002: PlzNavigate: detect when a ServiceWorker is present (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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/browser/loader/navigation_url_loader.h" 5 #include "content/browser/loader/navigation_url_loader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/frame_host/navigation_request_info.h" 9 #include "content/browser/frame_host/navigation_request_info.h"
10 #include "content/browser/loader/navigation_url_loader_factory.h" 10 #include "content/browser/loader/navigation_url_loader_factory.h"
11 #include "content/browser/loader/navigation_url_loader_impl.h" 11 #include "content/browser/loader/navigation_url_loader_impl.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 static NavigationURLLoaderFactory* g_factory = nullptr; 15 static NavigationURLLoaderFactory* g_factory = nullptr;
16 16
17 std::unique_ptr<NavigationURLLoader> NavigationURLLoader::Create( 17 std::unique_ptr<NavigationURLLoader> NavigationURLLoader::Create(
18 BrowserContext* browser_context, 18 BrowserContext* browser_context,
19 std::unique_ptr<NavigationRequestInfo> request_info, 19 std::unique_ptr<NavigationRequestInfo> request_info,
20 ServiceWorkerNavigationHandle* service_worker_handle, 20 ServiceWorkerContextWrapper* service_worker_context_wrapper,
21 NavigationURLLoaderDelegate* delegate) { 21 NavigationURLLoaderDelegate* delegate) {
22 if (g_factory) { 22 if (g_factory) {
23 return g_factory->CreateLoader(browser_context, std::move(request_info), 23 return g_factory->CreateLoader(browser_context, std::move(request_info),
24 service_worker_handle, delegate); 24 service_worker_context_wrapper, delegate);
25 } 25 }
26 return std::unique_ptr<NavigationURLLoader>( 26 return std::unique_ptr<NavigationURLLoader>(
27 new NavigationURLLoaderImpl(browser_context, std::move(request_info), 27 new NavigationURLLoaderImpl(browser_context, std::move(request_info),
28 service_worker_handle, delegate)); 28 service_worker_context_wrapper, delegate));
29 } 29 }
30 30
31 void NavigationURLLoader::SetFactoryForTesting( 31 void NavigationURLLoader::SetFactoryForTesting(
32 NavigationURLLoaderFactory* factory) { 32 NavigationURLLoaderFactory* factory) {
33 DCHECK(g_factory == nullptr || factory == nullptr); 33 DCHECK(g_factory == nullptr || factory == nullptr);
34 g_factory = factory; 34 g_factory = factory;
35 } 35 }
36 36
37 } // namespace content 37 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698