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

Side by Side Diff: content/browser/loader/throttling_resource_handler.h

Issue 2526983002: Refactor ResourceHandler API. (Closed)
Patch Set: Response to comments Created 3 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
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_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 20 matching lines...) Expand all
31 : public LayeredResourceHandler, 31 : public LayeredResourceHandler,
32 public ResourceThrottle::Delegate { 32 public ResourceThrottle::Delegate {
33 public: 33 public:
34 ThrottlingResourceHandler( 34 ThrottlingResourceHandler(
35 std::unique_ptr<ResourceHandler> next_handler, 35 std::unique_ptr<ResourceHandler> next_handler,
36 net::URLRequest* request, 36 net::URLRequest* request,
37 std::vector<std::unique_ptr<ResourceThrottle>> throttles); 37 std::vector<std::unique_ptr<ResourceThrottle>> throttles);
38 ~ThrottlingResourceHandler() override; 38 ~ThrottlingResourceHandler() override;
39 39
40 // LayeredResourceHandler overrides: 40 // LayeredResourceHandler overrides:
41 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, 41 void OnRequestRedirected(
42 ResourceResponse* response, 42 const net::RedirectInfo& redirect_info,
43 bool* defer) override; 43 ResourceResponse* response,
44 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; 44 std::unique_ptr<ResourceController> controller) override;
45 bool OnWillStart(const GURL& url, bool* defer) override; 45 void OnResponseStarted(
46 ResourceResponse* response,
47 std::unique_ptr<ResourceController> controller) override;
48 void OnWillStart(const GURL& url,
49 std::unique_ptr<ResourceController> controller) override;
46 50
47 // ResourceThrottle::Delegate implementation: 51 // ResourceThrottle::Delegate implementation:
48 void Cancel() override; 52 void Cancel() override;
49 void CancelAndIgnore() override; 53 void CancelAndIgnore() override;
50 void CancelWithError(int error_code) override; 54 void CancelWithError(int error_code) override;
51 void Resume() override; 55 void Resume() override;
52 56
53 private: 57 private:
54 void ResumeStart(); 58 void ResumeStart();
55 void ResumeRedirect(); 59 void ResumeRedirect();
(...skipping 19 matching lines...) Expand all
75 scoped_refptr<ResourceResponse> deferred_response_; 79 scoped_refptr<ResourceResponse> deferred_response_;
76 80
77 bool cancelled_by_resource_throttle_; 81 bool cancelled_by_resource_throttle_;
78 82
79 DISALLOW_COPY_AND_ASSIGN(ThrottlingResourceHandler); 83 DISALLOW_COPY_AND_ASSIGN(ThrottlingResourceHandler);
80 }; 84 };
81 85
82 } // namespace content 86 } // namespace content
83 87
84 #endif // CONTENT_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_ 88 #endif // CONTENT_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/test_resource_handler.cc ('k') | content/browser/loader/throttling_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698