| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |