| 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 <string> | 10 #include <string> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void OnDataReceivedACK(int request_id); | 63 void OnDataReceivedACK(int request_id); |
| 64 void OnUploadProgressACK(int request_id); | 64 void OnUploadProgressACK(int request_id); |
| 65 | 65 |
| 66 void ReportUploadProgress(); | 66 void ReportUploadProgress(); |
| 67 | 67 |
| 68 bool EnsureResourceBufferIsInitialized(); | 68 bool EnsureResourceBufferIsInitialized(); |
| 69 void ResumeIfDeferred(); | 69 void ResumeIfDeferred(); |
| 70 void OnDefer(); | 70 void OnDefer(); |
| 71 bool CheckForSufficientResource(); | 71 bool CheckForSufficientResource(); |
| 72 int CalculateEncodedDataLengthToReport(); | 72 int CalculateEncodedDataLengthToReport(); |
| 73 int CalculateEncodedBodyLengthToReport(); |
| 73 void RecordHistogram(); | 74 void RecordHistogram(); |
| 74 | 75 |
| 75 scoped_refptr<ResourceBuffer> buffer_; | 76 scoped_refptr<ResourceBuffer> buffer_; |
| 76 ResourceDispatcherHostImpl* rdh_; | 77 ResourceDispatcherHostImpl* rdh_; |
| 77 | 78 |
| 78 // Number of messages we've sent to the renderer that we haven't gotten an | 79 // Number of messages we've sent to the renderer that we haven't gotten an |
| 79 // ACK for. This allows us to avoid having too many messages in flight. | 80 // ACK for. This allows us to avoid having too many messages in flight. |
| 80 int pending_data_count_; | 81 int pending_data_count_; |
| 81 | 82 |
| 82 int allocation_size_; | 83 int allocation_size_; |
| 83 | 84 |
| 84 bool did_defer_; | 85 bool did_defer_; |
| 85 | 86 |
| 86 bool has_checked_for_sufficient_resources_; | 87 bool has_checked_for_sufficient_resources_; |
| 87 bool sent_received_response_msg_; | 88 bool sent_received_response_msg_; |
| 88 bool sent_data_buffer_msg_; | 89 bool sent_data_buffer_msg_; |
| 89 | 90 |
| 90 std::unique_ptr<InliningHelper> inlining_helper_; | 91 std::unique_ptr<InliningHelper> inlining_helper_; |
| 91 base::TimeTicks response_started_ticks_; | 92 base::TimeTicks response_started_ticks_; |
| 92 | 93 |
| 93 uint64_t last_upload_position_; | 94 uint64_t last_upload_position_; |
| 94 bool waiting_for_upload_progress_ack_; | 95 bool waiting_for_upload_progress_ack_; |
| 95 base::TimeTicks last_upload_ticks_; | 96 base::TimeTicks last_upload_ticks_; |
| 96 base::RepeatingTimer progress_timer_; | 97 base::RepeatingTimer progress_timer_; |
| 97 | 98 |
| 98 int64_t reported_transfer_size_; | 99 int64_t reported_transfer_size_; |
| 100 int64_t reported_encoded_body_length_; |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); | 102 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace content | 105 } // namespace content |
| 104 | 106 |
| 105 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ | 107 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
| OLD | NEW |