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

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

Issue 2481093003: Introduce ResourceRequesterInfo to abstract the requester of resource request (Closed)
Patch Set: fix URLLoaderFactoryImplTest/URLLoaderFactoryImplTest.GetFailedResponse2 Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_ASYNC_REVALIDATION_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_MANAGER_H_
6 #define CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_MANAGER_H_ 6 #define CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 19 matching lines...) Expand all
30 // ResourceDispatcherHostImpl. It also implements the creation of a new 30 // ResourceDispatcherHostImpl. It also implements the creation of a new
31 // net::URLRequest and AsyncRevalidationDriver from an existing net::URLRequest 31 // net::URLRequest and AsyncRevalidationDriver from an existing net::URLRequest
32 // that has had the stale-while-revalidate algorithm applied to it. 32 // that has had the stale-while-revalidate algorithm applied to it.
33 class AsyncRevalidationManager { 33 class AsyncRevalidationManager {
34 public: 34 public:
35 AsyncRevalidationManager(); 35 AsyncRevalidationManager();
36 ~AsyncRevalidationManager(); 36 ~AsyncRevalidationManager();
37 37
38 // Starts an async revalidation by copying |for_request|. |scheduler| must 38 // Starts an async revalidation by copying |for_request|. |scheduler| must
39 // remain valid until this object is destroyed. 39 // remain valid until this object is destroyed.
40 void BeginAsyncRevalidation(const net::URLRequest& for_request, 40 void BeginAsyncRevalidation(net::URLRequest* for_request,
41 ResourceScheduler* scheduler); 41 ResourceScheduler* scheduler);
42 42
43 // Cancel all pending async revalidations that use ResourceContext. 43 // Cancel all pending async revalidations that use ResourceContext.
44 void CancelAsyncRevalidationsForResourceContext( 44 void CancelAsyncRevalidationsForResourceContext(
45 ResourceContext* resource_context); 45 ResourceContext* resource_context);
46 46
47 static bool QualifiesForAsyncRevalidation(const ResourceRequest& request); 47 static bool QualifiesForAsyncRevalidation(const ResourceRequest& request);
48 48
49 private: 49 private:
50 // The key of the map of pending async revalidations. This key has a distinct 50 // The key of the map of pending async revalidations. This key has a distinct
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Map of AsyncRevalidationDriver instances that are currently in-flight: 98 // Map of AsyncRevalidationDriver instances that are currently in-flight:
99 // either waiting to be scheduled or active on the network. 99 // either waiting to be scheduled or active on the network.
100 AsyncRevalidationMap in_progress_; 100 AsyncRevalidationMap in_progress_;
101 101
102 DISALLOW_COPY_AND_ASSIGN(AsyncRevalidationManager); 102 DISALLOW_COPY_AND_ASSIGN(AsyncRevalidationManager);
103 }; 103 };
104 104
105 } // namespace content 105 } // namespace content
106 106
107 #endif // CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_MANAGER_H_ 107 #endif // CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/async_resource_handler_unittest.cc ('k') | content/browser/loader/async_revalidation_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698