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_ASYNC_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 void OnReadCompleted(int bytes_read, | 56 void OnReadCompleted(int bytes_read, |
57 std::unique_ptr<ResourceController> controller) override; | 57 std::unique_ptr<ResourceController> controller) override; |
58 void OnResponseCompleted( | 58 void OnResponseCompleted( |
59 const net::URLRequestStatus& status, | 59 const net::URLRequestStatus& status, |
60 std::unique_ptr<ResourceController> controller) override; | 60 std::unique_ptr<ResourceController> controller) override; |
61 void OnDataDownloaded(int bytes_downloaded) override; | 61 void OnDataDownloaded(int bytes_downloaded) override; |
62 | 62 |
63 private: | 63 private: |
64 class InliningHelper; | 64 class InliningHelper; |
65 | 65 |
| 66 // Asynchronously called by OnResponseStarted. If |should_cancel| is true, |
| 67 // cancels the resource load. |
| 68 void OnResponseStartedInternal(ResourceResponse* response, |
| 69 std::unique_ptr<ResourceController> controller, |
| 70 bool should_cancel); |
| 71 |
66 // IPC message handlers: | 72 // IPC message handlers: |
67 void OnFollowRedirect(int request_id); | 73 void OnFollowRedirect(int request_id); |
68 void OnDataReceivedACK(int request_id); | 74 void OnDataReceivedACK(int request_id); |
69 void OnUploadProgressACK(int request_id); | 75 void OnUploadProgressACK(int request_id); |
70 | 76 |
71 bool EnsureResourceBufferIsInitialized(); | 77 bool EnsureResourceBufferIsInitialized(); |
72 void ResumeIfDeferred(); | 78 void ResumeIfDeferred(); |
73 void OnDefer(std::unique_ptr<ResourceController> controller); | 79 void OnDefer(std::unique_ptr<ResourceController> controller); |
74 bool CheckForSufficientResource(); | 80 bool CheckForSufficientResource(); |
75 int CalculateEncodedDataLengthToReport(); | 81 int CalculateEncodedDataLengthToReport(); |
(...skipping 26 matching lines...) Expand all Loading... |
102 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; | 108 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; |
103 | 109 |
104 int64_t reported_transfer_size_; | 110 int64_t reported_transfer_size_; |
105 | 111 |
106 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); | 112 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); |
107 }; | 113 }; |
108 | 114 |
109 } // namespace content | 115 } // namespace content |
110 | 116 |
111 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ | 117 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
OLD | NEW |