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

Side by Side Diff: content/public/browser/resource_throttle.h

Issue 2164113002: Remove ResourceHandler::OnBeforeNetworkStart (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oops Created 4 years, 5 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
« no previous file with comments | « content/browser/loader/throttling_resource_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_ 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_
7 7
8 namespace net { 8 namespace net {
9 struct RedirectInfo; 9 struct RedirectInfo;
10 } 10 }
11 11
12 namespace content { 12 namespace content {
13 13
14 class AsyncRevalidationDriver; 14 class AsyncRevalidationDriver;
15 class ResourceController; 15 class ResourceController;
16 class ThrottlingResourceHandler; 16 class ThrottlingResourceHandler;
17 17
18 // A ResourceThrottle gets notified at various points during the process of 18 // A ResourceThrottle gets notified at various points during the process of
19 // loading a resource. At each stage, it has the opportunity to defer the 19 // loading a resource. At each stage, it has the opportunity to defer the
20 // resource load. The ResourceController interface may be used to resume a 20 // resource load. The ResourceController interface may be used to resume a
21 // deferred resource load, or it may be used to cancel a resource load at any 21 // deferred resource load, or it may be used to cancel a resource load at any
22 // time. 22 // time.
23 class ResourceThrottle { 23 class ResourceThrottle {
24 public: 24 public:
25 virtual ~ResourceThrottle() {} 25 virtual ~ResourceThrottle() {}
26 26
27 // Called before the resource request is started. 27 // Called before the resource request is started.
28 virtual void WillStartRequest(bool* defer) {} 28 virtual void WillStartRequest(bool* defer) {}
29 29
30 // Called before the resource request uses the network for the first time.
31 virtual void WillStartUsingNetwork(bool* defer) {}
32
33 // Called when the request was redirected. |redirect_info| contains the 30 // Called when the request was redirected. |redirect_info| contains the
34 // redirect responses's HTTP status code and some information about the new 31 // redirect responses's HTTP status code and some information about the new
35 // request that will be sent if the redirect is followed, including the new 32 // request that will be sent if the redirect is followed, including the new
36 // URL and new method. 33 // URL and new method.
37 virtual void WillRedirectRequest(const net::RedirectInfo& redirect_info, 34 virtual void WillRedirectRequest(const net::RedirectInfo& redirect_info,
38 bool* defer) {} 35 bool* defer) {}
39 36
40 // Called when the response headers and meta data are available. 37 // Called when the response headers and meta data are available.
41 virtual void WillProcessResponse(bool* defer) {} 38 virtual void WillProcessResponse(bool* defer) {}
42 39
(...skipping 14 matching lines...) Expand all
57 friend class AsyncRevalidationDriver; 54 friend class AsyncRevalidationDriver;
58 friend class ThrottlingResourceHandler; 55 friend class ThrottlingResourceHandler;
59 void set_controller(ResourceController* c) { controller_ = c; } 56 void set_controller(ResourceController* c) { controller_ = c; }
60 57
61 ResourceController* controller_; 58 ResourceController* controller_;
62 }; 59 };
63 60
64 } // namespace content 61 } // namespace content
65 62
66 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_ 63 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_
OLDNEW
« no previous file with comments | « content/browser/loader/throttling_resource_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698