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_SYNC_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_SYNC_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_LOADER_SYNC_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_SYNC_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 25 matching lines...) Expand all Loading... |
36 void OnRequestRedirected( | 36 void OnRequestRedirected( |
37 const net::RedirectInfo& redirect_info, | 37 const net::RedirectInfo& redirect_info, |
38 ResourceResponse* response, | 38 ResourceResponse* response, |
39 std::unique_ptr<ResourceController> controller) override; | 39 std::unique_ptr<ResourceController> controller) override; |
40 void OnResponseStarted( | 40 void OnResponseStarted( |
41 ResourceResponse* response, | 41 ResourceResponse* response, |
42 std::unique_ptr<ResourceController> controller) override; | 42 std::unique_ptr<ResourceController> controller) override; |
43 void OnWillStart(const GURL& url, | 43 void OnWillStart(const GURL& url, |
44 std::unique_ptr<ResourceController> controller) override; | 44 std::unique_ptr<ResourceController> controller) override; |
45 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 45 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
46 int* buf_size, | 46 int* buf_size) override; |
47 int min_size) override; | |
48 void OnReadCompleted(int bytes_read, | 47 void OnReadCompleted(int bytes_read, |
49 std::unique_ptr<ResourceController> controller) override; | 48 std::unique_ptr<ResourceController> controller) override; |
50 void OnResponseCompleted( | 49 void OnResponseCompleted( |
51 const net::URLRequestStatus& status, | 50 const net::URLRequestStatus& status, |
52 std::unique_ptr<ResourceController> controller) override; | 51 std::unique_ptr<ResourceController> controller) override; |
53 void OnDataDownloaded(int bytes_downloaded) override; | 52 void OnDataDownloaded(int bytes_downloaded) override; |
54 | 53 |
55 private: | 54 private: |
56 enum { kReadBufSize = 3840 }; | 55 enum { kReadBufSize = 3840 }; |
57 | 56 |
58 scoped_refptr<net::IOBuffer> read_buffer_; | 57 scoped_refptr<net::IOBuffer> read_buffer_; |
59 | 58 |
60 SyncLoadResult result_; | 59 SyncLoadResult result_; |
61 SyncLoadResultCallback result_handler_; | 60 SyncLoadResultCallback result_handler_; |
62 ResourceDispatcherHostImpl* rdh_; | 61 ResourceDispatcherHostImpl* rdh_; |
63 int64_t total_transfer_size_; | 62 int64_t total_transfer_size_; |
64 }; | 63 }; |
65 | 64 |
66 } // namespace content | 65 } // namespace content |
67 | 66 |
68 #endif // CONTENT_BROWSER_LOADER_SYNC_RESOURCE_HANDLER_H_ | 67 #endif // CONTENT_BROWSER_LOADER_SYNC_RESOURCE_HANDLER_H_ |
OLD | NEW |