| 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_RENDERER_HOST_THROTTLING_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_THROTTLING_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_THROTTLING_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_THROTTLING_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 ResourceResponse* response, | 33 ResourceResponse* response, |
| 34 bool* defer) OVERRIDE; | 34 bool* defer) OVERRIDE; |
| 35 virtual bool OnResponseStarted(int request_id, | 35 virtual bool OnResponseStarted(int request_id, |
| 36 content::ResourceResponse* response, | 36 content::ResourceResponse* response, |
| 37 bool* defer) OVERRIDE; | 37 bool* defer) OVERRIDE; |
| 38 virtual bool OnWillStart(int request_id, const GURL& url, | 38 virtual bool OnWillStart(int request_id, const GURL& url, |
| 39 bool* defer) OVERRIDE; | 39 bool* defer) OVERRIDE; |
| 40 | 40 |
| 41 // ResourceThrottleController implementation: | 41 // ResourceThrottleController implementation: |
| 42 virtual void Cancel() OVERRIDE; | 42 virtual void Cancel() OVERRIDE; |
| 43 virtual void CancelWithHandledExternally() OVERRIDE; |
| 43 virtual void Resume() OVERRIDE; | 44 virtual void Resume() OVERRIDE; |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 void ResumeStart(); | 47 void ResumeStart(); |
| 47 void ResumeRedirect(); | 48 void ResumeRedirect(); |
| 48 void ResumeResponse(); | 49 void ResumeResponse(); |
| 49 | 50 |
| 50 enum DeferredStage { | 51 enum DeferredStage { |
| 51 DEFERRED_NONE, | 52 DEFERRED_NONE, |
| 52 DEFERRED_START, | 53 DEFERRED_START, |
| 53 DEFERRED_REDIRECT, | 54 DEFERRED_REDIRECT, |
| 54 DEFERRED_RESPONSE | 55 DEFERRED_RESPONSE |
| 55 }; | 56 }; |
| 56 DeferredStage deferred_stage_; | 57 DeferredStage deferred_stage_; |
| 57 | 58 |
| 58 int request_id_; | 59 int request_id_; |
| 59 | 60 |
| 60 ScopedVector<ResourceThrottle> throttles_; | 61 ScopedVector<ResourceThrottle> throttles_; |
| 61 size_t index_; | 62 size_t index_; |
| 62 | 63 |
| 63 GURL deferred_url_; | 64 GURL deferred_url_; |
| 64 scoped_refptr<ResourceResponse> deferred_response_; | 65 scoped_refptr<ResourceResponse> deferred_response_; |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace content | 68 } // namespace content |
| 68 | 69 |
| 69 #endif // CONTENT_BROWSER_RENDERER_HOST_THROTTLING_RESOURCE_HANDLER_H_ | 70 #endif // CONTENT_BROWSER_RENDERER_HOST_THROTTLING_RESOURCE_HANDLER_H_ |
| OLD | NEW |