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

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

Issue 12243002: Pass WebKit priority changes and parsing messages up to the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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 #include <vector> 8 #include <vector>
9 9
10 class GURL; 10 class GURL;
11 11
12 namespace content { 12 namespace content {
13 13
14 class ResourceController; 14 class ResourceController;
15 15
16 // A ResourceThrottle gets notified at various points during the process of 16 // A ResourceThrottle gets notified at various points during the process of
17 // loading a resource. At each stage, it has the opportunity to defer the 17 // loading a resource. At each stage, it has the opportunity to defer the
18 // resource load. The ResourceController interface may be used to resume a 18 // resource load. The ResourceController interface may be used to resume a
19 // deferred resource load, or it may be used to cancel a resource load at any 19 // deferred resource load, or it may be used to cancel a resource load at any
20 // time. 20 // time.
21 class ResourceThrottle { 21 class ResourceThrottle {
22 public: 22 public:
23 virtual ~ResourceThrottle() {} 23 virtual ~ResourceThrottle() {}
24 24
25 virtual void WillStartRequest(bool* defer) {} 25 virtual void WillStartRequest(bool* defer) {}
26 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) {} 26 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) {}
27 virtual void WillProcessResponse(bool* defer) {} 27 virtual void WillProcessResponse(bool* defer) {}
28 virtual void OnRequestPriorityChanged() {}
darin (slow to review) 2013/02/06 05:04:13 Hmm, this doesn't quite fit with the scope of Reso
28 29
29 void set_controller_for_testing(ResourceController* c) { 30 void set_controller_for_testing(ResourceController* c) {
30 controller_ = c; 31 controller_ = c;
31 } 32 }
32 33
33 protected: 34 protected:
34 ResourceThrottle() : controller_(NULL) {} 35 ResourceThrottle() : controller_(NULL) {}
35 ResourceController* controller() { return controller_; } 36 ResourceController* controller() { return controller_; }
36 37
37 private: 38 private:
38 friend class ThrottlingResourceHandler; 39 friend class ThrottlingResourceHandler;
39 void set_controller(ResourceController* c) { controller_ = c; } 40 void set_controller(ResourceController* c) { controller_ = c; }
40 41
41 ResourceController* controller_; 42 ResourceController* controller_;
42 }; 43 };
43 44
44 } // namespace content 45 } // namespace content
45 46
46 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_ 47 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698