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 #include "content/browser/download/download_file_manager.h" | 5 #include "content/browser/download/download_file_manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "content/browser/download/download_buffer.h" | 15 #include "content/browser/download/download_buffer.h" |
16 #include "content/browser/download/download_create_info.h" | 16 #include "content/browser/download/download_create_info.h" |
17 #include "content/browser/download/download_file.h" | 17 #include "content/browser/download/download_file.h" |
18 #include "content/browser/download/download_manager.h" | 18 #include "content/browser/download/download_manager.h" |
19 #include "content/browser/download/download_request_handle.h" | 19 #include "content/browser/download/download_request_handle.h" |
20 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 20 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
21 #include "content/browser/tab_contents/tab_contents.h" | 21 #include "content/browser/tab_contents/tab_contents.h" |
22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/browser/download_manager_delegate.h" | 23 #include "content/public/browser/download_manager_delegate.h" |
24 #include "googleurl/src/gurl.h" | 24 #include "googleurl/src/gurl.h" |
25 #include "net/base/io_buffer.h" | 25 #include "net/base/io_buffer.h" |
26 | 26 |
| 27 using content::BrowserThread; |
| 28 |
27 namespace { | 29 namespace { |
28 | 30 |
29 // Throttle updates to the UI thread so that a fast moving download doesn't | 31 // Throttle updates to the UI thread so that a fast moving download doesn't |
30 // cause it to become unresponsive (in milliseconds). | 32 // cause it to become unresponsive (in milliseconds). |
31 const int kUpdatePeriodMs = 500; | 33 const int kUpdatePeriodMs = 500; |
32 | 34 |
33 } // namespace | 35 } // namespace |
34 | 36 |
35 DownloadFileManager::DownloadFileManager(ResourceDispatcherHost* rdh) | 37 DownloadFileManager::DownloadFileManager(ResourceDispatcherHost* rdh) |
36 : resource_dispatcher_host_(rdh) { | 38 : resource_dispatcher_host_(rdh) { |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 << " id = " << global_id | 418 << " id = " << global_id |
417 << " download_file = " << download_file->DebugString(); | 419 << " download_file = " << download_file->DebugString(); |
418 | 420 |
419 downloads_.erase(global_id); | 421 downloads_.erase(global_id); |
420 | 422 |
421 delete download_file; | 423 delete download_file; |
422 | 424 |
423 if (downloads_.empty()) | 425 if (downloads_.empty()) |
424 StopUpdateTimer(); | 426 StopUpdateTimer(); |
425 } | 427 } |
OLD | NEW |