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

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

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, 6 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 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_H_
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_H_ 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 class BrowserContext; 15 class BrowserContext;
16 class NavigationURLLoaderDelegate; 16 class NavigationURLLoaderDelegate;
17 class NavigationURLLoaderFactory; 17 class NavigationURLLoaderFactory;
18 class ServiceWorkerNavigationHandle; 18 class ServiceWorkerContextWrapper;
19 struct CommonNavigationParams; 19 struct CommonNavigationParams;
20 struct NavigationRequestInfo; 20 struct NavigationRequestInfo;
21 21
22 // PlzNavigate: The navigation logic's UI thread entry point into the resource 22 // PlzNavigate: The navigation logic's UI thread entry point into the resource
23 // loading stack. It exposes an interface to control the request prior to 23 // loading stack. It exposes an interface to control the request prior to
24 // receiving the response. If the NavigationURLLoader is destroyed before 24 // receiving the response. If the NavigationURLLoader is destroyed before
25 // OnResponseStarted is called, the request is aborted. 25 // OnResponseStarted is called, the request is aborted.
26 class CONTENT_EXPORT NavigationURLLoader { 26 class CONTENT_EXPORT NavigationURLLoader {
27 public: 27 public:
28 // Creates a NavigationURLLoader. The caller is responsible for ensuring that 28 // Creates a NavigationURLLoader. The caller is responsible for ensuring that
29 // |delegate| outlives the loader. |request_body| must not be accessed on the 29 // |delegate| outlives the loader. |request_body| must not be accessed on the
30 // UI thread after this point. 30 // UI thread after this point.
31 // 31 //
32 // TODO(davidben): When navigation is disentangled from the loader, the 32 // TODO(davidben): When navigation is disentangled from the loader, the
33 // request parameters should not come in as a navigation-specific 33 // request parameters should not come in as a navigation-specific
34 // structure. Information like has_user_gesture and 34 // structure. Information like has_user_gesture and
35 // should_replace_current_entry shouldn't be needed at this layer. 35 // should_replace_current_entry shouldn't be needed at this layer.
36 static std::unique_ptr<NavigationURLLoader> Create( 36 static std::unique_ptr<NavigationURLLoader> Create(
37 BrowserContext* browser_context, 37 BrowserContext* browser_context,
38 std::unique_ptr<NavigationRequestInfo> request_info, 38 std::unique_ptr<NavigationRequestInfo> request_info,
39 ServiceWorkerNavigationHandle* service_worker_handle, 39 ServiceWorkerContextWrapper* service_worker_context_wrapper,
40 NavigationURLLoaderDelegate* delegate); 40 NavigationURLLoaderDelegate* delegate);
41 41
42 // For testing purposes; sets the factory for use in testing. 42 // For testing purposes; sets the factory for use in testing.
43 static void SetFactoryForTesting(NavigationURLLoaderFactory* factory); 43 static void SetFactoryForTesting(NavigationURLLoaderFactory* factory);
44 44
45 virtual ~NavigationURLLoader() {} 45 virtual ~NavigationURLLoader() {}
46 46
47 // Called in response to OnRequestRedirected to continue processing the 47 // Called in response to OnRequestRedirected to continue processing the
48 // request. 48 // request.
49 virtual void FollowRedirect() = 0; 49 virtual void FollowRedirect() = 0;
50 50
51 // Called in response to OnResponseStarted to process the response. 51 // Called in response to OnResponseStarted to process the response.
52 virtual void ProceedWithResponse() = 0; 52 virtual void ProceedWithResponse() = 0;
53 53
54 protected: 54 protected:
55 NavigationURLLoader() {} 55 NavigationURLLoader() {}
56 56
57 private: 57 private:
58 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoader); 58 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoader);
59 }; 59 };
60 60
61 } // namespace content 61 } // namespace content
62 62
63 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_H_ 63 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698