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

Side by Side Diff: chrome/browser/renderer_host/predictor_resource_throttle.h

Issue 1857383002: Refactor net predictor to use ResourceThrottles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more comment changes Created 4 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 2016 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_RENDERER_HOST_PREDICTOR_RESOURCE_THROTTLE_H_
6 #define CHROME_BROWSER_RENDERER_HOST_PREDICTOR_RESOURCE_THROTTLE_H_
7
8 #include "base/macros.h"
9 #include "content/public/browser/resource_throttle.h"
10
11 namespace chrome_browser_net {
12 class Predictor;
13 }
14
15 namespace net {
16 struct RedirectInfo;
17 class URLRequest;
18 }
19
20 // This resource throttle tracks requests in order to help the predictor learn
21 // resource relationships. It notifies the predictor of all redirect and
22 // referrer relationship, and populates the predictor's timed cache of ongoing
mmenke 2016/05/23 18:50:22 relationship->relationships
Charlie Harrison 2016/05/23 21:13:32 Done.
23 // navigations. It also initiates predictive actions based on subframe
24 // requests and redirects.
25 // Note: This class does not issue predictive actions off of main frame
26 // requests. That is done on the UI thread in response to navigation callbacks
27 // in predictor_tab_helper.cc.
28 // TODO(csharrison): This class shouldn't depend on chrome_browser_net. The
29 // predictor should probably be moved here (along with its dependencies).
30 class PredictorResourceThrottle : public content::ResourceThrottle {
31 public:
32 PredictorResourceThrottle(net::URLRequest* request,
33 chrome_browser_net::Predictor* predictor);
34 ~PredictorResourceThrottle() override;
35
36 // content::ResourceThrottle:
37 void WillStartRequest(bool* defer) override;
38 void WillRedirectRequest(const net::RedirectInfo& redirect_info,
39 bool* defer) override;
40 const char* GetNameForLogging() const override;
41
42 private:
43 net::URLRequest* request_;
44 chrome_browser_net::Predictor* predictor_;
45
46 DISALLOW_COPY_AND_ASSIGN(PredictorResourceThrottle);
47 };
48
49 #endif // CHROME_BROWSER_RENDERER_HOST_PREDICTOR_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698