OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_NET_RESOURCE_PREFETCH_PREDICTOR_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_NET_RESOURCE_PREFETCH_PREDICTOR_OBSERVER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 11 |
| 12 namespace net { |
| 13 class URLRequest; |
| 14 } |
| 15 |
| 16 namespace chrome_browser_net { |
| 17 |
| 18 class ResourcePrefetchPredictorObserver { |
| 19 public: |
| 20 explicit ResourcePrefetchPredictorObserver( |
| 21 predictors::ResourcePrefetchPredictor* predictor); |
| 22 ~ResourcePrefetchPredictorObserver(); |
| 23 |
| 24 // Parts of the NetworkDelegate that we want to observe. |
| 25 void OnRequestStarted(net::URLRequest* request, |
| 26 ResourceType::Type resource_type, |
| 27 int child_id, |
| 28 int route_id); |
| 29 void OnRequestRedirected(net::URLRequest* request); |
| 30 void OnResponseStarted(net::URLRequest* request); |
| 31 |
| 32 private: |
| 33 base::WeakPtr<predictors::ResourcePrefetchPredictor> predictor_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictorObserver); |
| 36 }; |
| 37 |
| 38 } // namespace chrome_browser_net |
| 39 |
| 40 #endif // CHROME_BROWSER_NET_RESOURCE_PREFETCH_PREDICTOR_OBSERVER_H_ |
OLD | NEW |