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_DRIVER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_DRIVER_H_ |
6 #define CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_DRIVER_H_ | 6 #define CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_DRIVER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/public/browser/resource_controller.h" | 17 #include "content/public/browser/resource_controller.h" |
18 #include "content/public/browser/resource_throttle.h" | 18 #include "content/public/browser/resource_throttle.h" |
19 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
20 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
21 | 21 |
22 namespace net { | |
23 class HttpCache; | |
24 } | |
25 | |
26 namespace content { | 22 namespace content { |
27 | 23 |
28 // This class is responsible for driving the URLRequest for an async | 24 // This class is responsible for driving the URLRequest for an async |
29 // revalidation. It is passed an instance of ResourceThrottle created by | 25 // revalidation. It is passed an instance of ResourceThrottle created by |
30 // content::ResourceScheduler to perform throttling on the request. | 26 // content::ResourceScheduler to perform throttling on the request. |
31 class CONTENT_EXPORT AsyncRevalidationDriver : public net::URLRequest::Delegate, | 27 class CONTENT_EXPORT AsyncRevalidationDriver : public net::URLRequest::Delegate, |
32 public ResourceController { | 28 public ResourceController { |
33 public: | 29 public: |
34 // |completion_callback| is guaranteed to be called on completion, | 30 // |completion_callback| is guaranteed to be called on completion, |
35 // regardless of success or failure. | 31 // regardless of success or failure. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 base::Closure completion_callback_; | 90 base::Closure completion_callback_; |
95 | 91 |
96 base::WeakPtrFactory<AsyncRevalidationDriver> weak_ptr_factory_; | 92 base::WeakPtrFactory<AsyncRevalidationDriver> weak_ptr_factory_; |
97 | 93 |
98 DISALLOW_COPY_AND_ASSIGN(AsyncRevalidationDriver); | 94 DISALLOW_COPY_AND_ASSIGN(AsyncRevalidationDriver); |
99 }; | 95 }; |
100 | 96 |
101 } // namespace content | 97 } // namespace content |
102 | 98 |
103 #endif // CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_DRIVER_H_ | 99 #endif // CONTENT_BROWSER_LOADER_ASYNC_REVALIDATION_DRIVER_H_ |
OLD | NEW |