OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DETACHABLE_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 52 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
53 ResourceResponse* response, | 53 ResourceResponse* response, |
54 bool* defer) override; | 54 bool* defer) override; |
55 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; | 55 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; |
56 bool OnWillStart(const GURL& url, bool* defer) override; | 56 bool OnWillStart(const GURL& url, bool* defer) override; |
57 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 57 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
58 int* buf_size, | 58 int* buf_size, |
59 int min_size) override; | 59 int min_size) override; |
60 bool OnReadCompleted(int bytes_read, bool* defer) override; | 60 bool OnReadCompleted(int bytes_read, bool* defer) override; |
61 void OnResponseCompleted(const net::URLRequestStatus& status, | 61 void OnResponseCompleted(const net::URLRequestStatus& status, |
62 const std::string& security_info, | |
63 bool* defer) override; | 62 bool* defer) override; |
64 void OnDataDownloaded(int bytes_downloaded) override; | 63 void OnDataDownloaded(int bytes_downloaded) override; |
65 | 64 |
66 // ResourceController implementation: | 65 // ResourceController implementation: |
67 void Resume() override; | 66 void Resume() override; |
68 void Cancel() override; | 67 void Cancel() override; |
69 void CancelAndIgnore() override; | 68 void CancelAndIgnore() override; |
70 void CancelWithError(int error_code) override; | 69 void CancelWithError(int error_code) override; |
71 | 70 |
72 private: | 71 private: |
73 std::unique_ptr<ResourceHandler> next_handler_; | 72 std::unique_ptr<ResourceHandler> next_handler_; |
74 scoped_refptr<net::IOBuffer> read_buffer_; | 73 scoped_refptr<net::IOBuffer> read_buffer_; |
75 | 74 |
76 std::unique_ptr<base::OneShotTimer> detached_timer_; | 75 std::unique_ptr<base::OneShotTimer> detached_timer_; |
77 base::TimeDelta cancel_delay_; | 76 base::TimeDelta cancel_delay_; |
78 | 77 |
79 bool is_deferred_; | 78 bool is_deferred_; |
80 bool is_finished_; | 79 bool is_finished_; |
81 | 80 |
82 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler); | 81 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler); |
83 }; | 82 }; |
84 | 83 |
85 } // namespace content | 84 } // namespace content |
86 | 85 |
87 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ | 86 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ |
OLD | NEW |