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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void OnRequestRedirected( | 54 void OnRequestRedirected( |
55 const net::RedirectInfo& redirect_info, | 55 const net::RedirectInfo& redirect_info, |
56 ResourceResponse* response, | 56 ResourceResponse* response, |
57 std::unique_ptr<ResourceController> controller) override; | 57 std::unique_ptr<ResourceController> controller) override; |
58 void OnResponseStarted( | 58 void OnResponseStarted( |
59 ResourceResponse* response, | 59 ResourceResponse* response, |
60 std::unique_ptr<ResourceController> controller) override; | 60 std::unique_ptr<ResourceController> controller) override; |
61 void OnWillStart(const GURL& url, | 61 void OnWillStart(const GURL& url, |
62 std::unique_ptr<ResourceController> controller) override; | 62 std::unique_ptr<ResourceController> controller) override; |
63 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 63 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
64 int* buf_size, | 64 int* buf_size) override; |
65 int min_size) override; | |
66 void OnReadCompleted(int bytes_read, | 65 void OnReadCompleted(int bytes_read, |
67 std::unique_ptr<ResourceController> controller) override; | 66 std::unique_ptr<ResourceController> controller) override; |
68 void OnResponseCompleted( | 67 void OnResponseCompleted( |
69 const net::URLRequestStatus& status, | 68 const net::URLRequestStatus& status, |
70 std::unique_ptr<ResourceController> controller) override; | 69 std::unique_ptr<ResourceController> controller) override; |
71 void OnDataDownloaded(int bytes_downloaded) override; | 70 void OnDataDownloaded(int bytes_downloaded) override; |
72 | 71 |
73 private: | 72 private: |
74 class Controller; | 73 class Controller; |
75 | 74 |
76 void OnTimedOut(); | 75 void OnTimedOut(); |
77 | 76 |
78 std::unique_ptr<ResourceHandler> next_handler_; | 77 std::unique_ptr<ResourceHandler> next_handler_; |
79 scoped_refptr<net::IOBuffer> read_buffer_; | 78 scoped_refptr<net::IOBuffer> read_buffer_; |
80 | 79 |
81 std::unique_ptr<base::OneShotTimer> detached_timer_; | 80 std::unique_ptr<base::OneShotTimer> detached_timer_; |
82 base::TimeDelta cancel_delay_; | 81 base::TimeDelta cancel_delay_; |
83 | 82 |
84 bool is_finished_; | 83 bool is_finished_; |
85 | 84 |
86 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler); | 85 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler); |
87 }; | 86 }; |
88 | 87 |
89 } // namespace content | 88 } // namespace content |
90 | 89 |
91 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ | 90 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ |
OLD | NEW |