| 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_DOWNLOAD_DOWNLOAD_REQUEST_CORE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_CORE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_CORE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_CORE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <string> | 11 #include <string> |
| 9 | 12 |
| 10 #include "base/callback.h" | 13 #include "base/callback.h" |
| 11 #include "base/macros.h" | 14 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 14 #include "content/browser/loader/resource_handler.h" | 17 #include "content/browser/loader/resource_handler.h" |
| 15 #include "content/public/browser/download_interrupt_reasons.h" | 18 #include "content/public/browser/download_interrupt_reasons.h" |
| 16 #include "content/public/browser/download_save_info.h" | 19 #include "content/public/browser/download_save_info.h" |
| 17 #include "content/public/browser/download_url_parameters.h" | 20 #include "content/public/browser/download_url_parameters.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // system enters power saving mode while a request is alive, it can cause the | 114 // system enters power saving mode while a request is alive, it can cause the |
| 112 // request to fail and the associated download will be interrupted. | 115 // request to fail and the associated download will be interrupted. |
| 113 scoped_ptr<PowerSaveBlocker> power_save_blocker_; | 116 scoped_ptr<PowerSaveBlocker> power_save_blocker_; |
| 114 | 117 |
| 115 // The following are used to collect stats. | 118 // The following are used to collect stats. |
| 116 base::TimeTicks download_start_time_; | 119 base::TimeTicks download_start_time_; |
| 117 base::TimeTicks last_read_time_; | 120 base::TimeTicks last_read_time_; |
| 118 base::TimeTicks last_stream_pause_time_; | 121 base::TimeTicks last_stream_pause_time_; |
| 119 base::TimeDelta total_pause_time_; | 122 base::TimeDelta total_pause_time_; |
| 120 size_t last_buffer_size_; | 123 size_t last_buffer_size_; |
| 121 int64 bytes_read_; | 124 int64_t bytes_read_; |
| 122 | 125 |
| 123 int pause_count_; | 126 int pause_count_; |
| 124 bool was_deferred_; | 127 bool was_deferred_; |
| 125 | 128 |
| 126 // Each successful OnWillRead will yield a buffer of this size. | 129 // Each successful OnWillRead will yield a buffer of this size. |
| 127 static const int kReadBufSize = 32768; // bytes | 130 static const int kReadBufSize = 32768; // bytes |
| 128 | 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(DownloadRequestCore); | 132 DISALLOW_COPY_AND_ASSIGN(DownloadRequestCore); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace content | 135 } // namespace content |
| 133 | 136 |
| 134 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_CORE_H_ | 137 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_CORE_H_ |
| OLD | NEW |