| 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 "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class ThrottlingResourceHandler : public LayeredResourceHandler, | 27 class ThrottlingResourceHandler : public LayeredResourceHandler, |
| 28 public ResourceController { | 28 public ResourceController { |
| 29 public: | 29 public: |
| 30 // Takes ownership of the ResourceThrottle instances. | 30 // Takes ownership of the ResourceThrottle instances. |
| 31 ThrottlingResourceHandler(std::unique_ptr<ResourceHandler> next_handler, | 31 ThrottlingResourceHandler(std::unique_ptr<ResourceHandler> next_handler, |
| 32 net::URLRequest* request, | 32 net::URLRequest* request, |
| 33 ScopedVector<ResourceThrottle> throttles); | 33 ScopedVector<ResourceThrottle> throttles); |
| 34 ~ThrottlingResourceHandler() override; | 34 ~ThrottlingResourceHandler() override; |
| 35 | 35 |
| 36 // LayeredResourceHandler overrides: | 36 // LayeredResourceHandler overrides: |
| 37 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 37 void OnRequestRedirected(const net::RedirectInfo& redirect_info, |
| 38 ResourceResponse* response, | 38 ResourceResponse* response, |
| 39 bool* defer) override; | 39 bool* defer_or_cancel) override; |
| 40 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; | 40 void OnResponseStarted(ResourceResponse* response, |
| 41 bool OnWillStart(const GURL& url, bool* defer) override; | 41 bool* defer_or_cancel) override; |
| 42 void OnWillStart(const GURL& url, bool* defer_or_cancel) override; |
| 42 | 43 |
| 43 // ResourceController implementation: | 44 // ResourceController implementation: |
| 44 void Cancel() override; | 45 void Cancel() override; |
| 45 void CancelAndIgnore() override; | 46 void CancelAndIgnore() override; |
| 46 void CancelWithError(int error_code) override; | 47 void CancelWithError(int error_code) override; |
| 47 void Resume() override; | 48 void Resume() override; |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 void ResumeStart(); | 51 void ResumeStart(); |
| 51 void ResumeRedirect(); | 52 void ResumeRedirect(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 69 GURL deferred_url_; | 70 GURL deferred_url_; |
| 70 net::RedirectInfo deferred_redirect_; | 71 net::RedirectInfo deferred_redirect_; |
| 71 scoped_refptr<ResourceResponse> deferred_response_; | 72 scoped_refptr<ResourceResponse> deferred_response_; |
| 72 | 73 |
| 73 bool cancelled_by_resource_throttle_; | 74 bool cancelled_by_resource_throttle_; |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 } // namespace content | 77 } // namespace content |
| 77 | 78 |
| 78 #endif // CONTENT_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_ | 79 #endif // CONTENT_BROWSER_LOADER_THROTTLING_RESOURCE_HANDLER_H_ |
| OLD | NEW |