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_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void CancelRequest(); | 82 void CancelRequest(); |
83 | 83 |
84 std::string DebugString() const; | 84 std::string DebugString() const; |
85 | 85 |
86 private: | 86 private: |
87 virtual ~DownloadResourceHandler(); | 87 virtual ~DownloadResourceHandler(); |
88 | 88 |
89 // Arrange for started_cb_ to be called on the UI thread with the | 89 // Arrange for started_cb_ to be called on the UI thread with the |
90 // below values, nulling out started_cb_. Should only be called | 90 // below values, nulling out started_cb_. Should only be called |
91 // on the IO thread. | 91 // on the IO thread. |
92 void CallStartedCB(content::DownloadId id, net::Error error); | 92 void CallStartedCB(content::DownloadItem* item, net::Error error); |
93 | 93 |
94 // If the content-length header is not present (or contains something other | 94 // If the content-length header is not present (or contains something other |
95 // than numbers), the incoming content_length is -1 (unknown size). | 95 // than numbers), the incoming content_length is -1 (unknown size). |
96 // Set the content length to 0 to indicate unknown size to DownloadManager. | 96 // Set the content length to 0 to indicate unknown size to DownloadManager. |
97 void SetContentLength(const int64& content_length); | 97 void SetContentLength(const int64& content_length); |
98 | 98 |
99 void SetContentDisposition(const std::string& content_disposition); | 99 void SetContentDisposition(const std::string& content_disposition); |
100 | 100 |
101 content::GlobalRequestID global_id_; | 101 content::GlobalRequestID global_id_; |
102 int render_view_id_; | 102 int render_view_id_; |
(...skipping 24 matching lines...) Expand all Loading... |
127 // For DCHECKing | 127 // For DCHECKing |
128 bool on_response_started_called_; | 128 bool on_response_started_called_; |
129 | 129 |
130 static const int kReadBufSize = 32768; // bytes | 130 static const int kReadBufSize = 32768; // bytes |
131 static const int kThrottleTimeMs = 200; // milliseconds | 131 static const int kThrottleTimeMs = 200; // milliseconds |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 133 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
134 }; | 134 }; |
135 | 135 |
136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ | 136 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_RESOURCE_HANDLER_H_ |
OLD | NEW |