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

Side by Side Diff: chrome/browser/net/resource_prefetch_predictor_observer.h

Issue 10416002: Seculative resource prefetching for URLs CL. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing dominich's and willchan's comments. Created 8 years, 7 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
(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/ref_counted.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 scoped_refptr<predictors::ResourcePrefetchPredictor> predictor);
22 ~ResourcePrefetchPredictorObserver();
23
24 // Parts of the NetworkDelegate that we want to observe.
25 void OnBeforeURLRequest(net::URLRequest* request);
26 void OnBeforeRedirect(net::URLRequest* request);
27 void OnResponseStarted(net::URLRequest* request);
28
29 private:
30 void CallPredictorOnUIThread(
31 net::URLRequest* request,
32 bool is_response,
33 void(predictors::ResourcePrefetchPredictor::*recordFunction)
34 (const predictors::ResourcePrefetchPredictor::URLRequestSummary&)) const;
35
36 scoped_refptr<predictors::ResourcePrefetchPredictor> predictor_;
37
38 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictorObserver);
39 };
40
41 } // namespace chrome_browser_net
42
43 #endif // CHROME_BROWSER_NET_RESOURCE_PREFETCH_PREDICTOR_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698