OLD | NEW |
---|---|
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 Loading... | |
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, |
yhirano
2016/11/29 03:51:51
Google C++ style guide requires a reference parame
horo
2016/11/29 04:38:31
Done.
| |
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 Loading... | |
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_ |
OLD | NEW |