| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 DOWNLOAD_URL_CHECKS_MAX | 84 DOWNLOAD_URL_CHECKS_MAX |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 ~DownloadResourceHandler(); | 87 ~DownloadResourceHandler(); |
| 88 | 88 |
| 89 void StartPauseTimer(); | 89 void StartPauseTimer(); |
| 90 | 90 |
| 91 void StartDownloadUrlCheck(); | 91 void StartDownloadUrlCheck(); |
| 92 | 92 |
| 93 // Called when the result of checking a download URL is known. | 93 // Called when the result of checking a download URL is known. |
| 94 void OnDownloadUrlCheckResult(const GURL& url, | 94 virtual void OnDownloadUrlCheckResult( |
| 95 SafeBrowsingService::UrlCheckResult result); | 95 const GURL& url, |
| 96 SafeBrowsingService::UrlCheckResult result); |
| 96 | 97 |
| 97 // A helper function that updates UMA for download url checks. | 98 // A helper function that updates UMA for download url checks. |
| 98 static void UpdateDownloadUrlCheckStats(SBStatsType stat_type); | 99 static void UpdateDownloadUrlCheckStats(SBStatsType stat_type); |
| 99 | 100 |
| 100 int download_id_; | 101 int download_id_; |
| 101 GlobalRequestID global_id_; | 102 GlobalRequestID global_id_; |
| 102 int render_view_id_; | 103 int render_view_id_; |
| 103 scoped_refptr<net::IOBuffer> read_buffer_; | 104 scoped_refptr<net::IOBuffer> read_buffer_; |
| 104 std::string content_disposition_; | 105 std::string content_disposition_; |
| 105 GURL url_; // final URL from which we're downloading. | 106 GURL url_; // final URL from which we're downloading. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 117 base::TimeTicks download_start_time_; // used to collect stats. | 118 base::TimeTicks download_start_time_; // used to collect stats. |
| 118 | 119 |
| 119 static const int kReadBufSize = 32768; // bytes | 120 static const int kReadBufSize = 32768; // bytes |
| 120 static const size_t kLoadsToWrite = 100; // number of data buffers queued | 121 static const size_t kLoadsToWrite = 100; // number of data buffers queued |
| 121 static const int kThrottleTimeMs = 200; // milliseconds | 122 static const int kThrottleTimeMs = 200; // milliseconds |
| 122 | 123 |
| 123 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); | 124 DISALLOW_COPY_AND_ASSIGN(DownloadResourceHandler); |
| 124 }; | 125 }; |
| 125 | 126 |
| 126 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ | 127 #endif // CHROME_BROWSER_RENDERER_HOST_DOWNLOAD_RESOURCE_HANDLER_H_ |
| OLD | NEW |