| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool* defer) OVERRIDE; | 61 bool* defer) OVERRIDE; |
| 62 virtual void OnResponseCompleted(int request_id, | 62 virtual void OnResponseCompleted(int request_id, |
| 63 const net::URLRequestStatus& status, | 63 const net::URLRequestStatus& status, |
| 64 const std::string& security_info, | 64 const std::string& security_info, |
| 65 bool* defer) OVERRIDE; | 65 bool* defer) OVERRIDE; |
| 66 virtual void OnDataDownloaded(int request_id, | 66 virtual void OnDataDownloaded(int request_id, |
| 67 int bytes_downloaded) OVERRIDE; | 67 int bytes_downloaded) OVERRIDE; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // IPC message handlers: | 70 // IPC message handlers: |
| 71 void OnFollowRedirect(int request_id, | 71 void OnFollowRedirect(int request_id); |
| 72 bool has_new_first_party_for_cookies, | |
| 73 const GURL& new_first_party_for_cookies); | |
| 74 void OnDataReceivedACK(int request_id); | 72 void OnDataReceivedACK(int request_id); |
| 75 | 73 |
| 76 bool EnsureResourceBufferIsInitialized(); | 74 bool EnsureResourceBufferIsInitialized(); |
| 77 void ResumeIfDeferred(); | 75 void ResumeIfDeferred(); |
| 78 void OnDefer(); | 76 void OnDefer(); |
| 79 | 77 |
| 80 scoped_refptr<ResourceBuffer> buffer_; | 78 scoped_refptr<ResourceBuffer> buffer_; |
| 81 ResourceDispatcherHostImpl* rdh_; | 79 ResourceDispatcherHostImpl* rdh_; |
| 82 | 80 |
| 83 // Number of messages we've sent to the renderer that we haven't gotten an | 81 // Number of messages we've sent to the renderer that we haven't gotten an |
| 84 // ACK for. This allows us to avoid having too many messages in flight. | 82 // ACK for. This allows us to avoid having too many messages in flight. |
| 85 int pending_data_count_; | 83 int pending_data_count_; |
| 86 | 84 |
| 87 int allocation_size_; | 85 int allocation_size_; |
| 88 | 86 |
| 89 bool did_defer_; | 87 bool did_defer_; |
| 90 | 88 |
| 91 bool has_checked_for_sufficient_resources_; | 89 bool has_checked_for_sufficient_resources_; |
| 92 bool sent_received_response_msg_; | 90 bool sent_received_response_msg_; |
| 93 bool sent_first_data_msg_; | 91 bool sent_first_data_msg_; |
| 94 | 92 |
| 95 int64_t reported_transfer_size_; | 93 int64_t reported_transfer_size_; |
| 96 | 94 |
| 97 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); | 95 DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler); |
| 98 }; | 96 }; |
| 99 | 97 |
| 100 } // namespace content | 98 } // namespace content |
| 101 | 99 |
| 102 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ | 100 #endif // CONTENT_BROWSER_LOADER_ASYNC_RESOURCE_HANDLER_H_ |
| OLD | NEW |