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 "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/task.h" | 10 #include "base/task.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "content/browser/browser_thread.h" | |
13 #include "content/browser/download/download_buffer.h" | 12 #include "content/browser/download/download_buffer.h" |
14 #include "content/browser/download/download_create_info.h" | 13 #include "content/browser/download/download_create_info.h" |
15 #include "content/browser/download/download_file.h" | 14 #include "content/browser/download/download_file.h" |
16 #include "content/browser/download/download_manager.h" | 15 #include "content/browser/download/download_manager.h" |
17 #include "content/browser/download/download_request_handle.h" | 16 #include "content/browser/download/download_request_handle.h" |
18 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 17 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
19 #include "content/browser/tab_contents/tab_contents.h" | 18 #include "content/browser/tab_contents/tab_contents.h" |
| 19 #include "content/public/browser/browser_thread.h" |
20 #include "content/public/browser/download_manager_delegate.h" | 20 #include "content/public/browser/download_manager_delegate.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 #include "net/base/io_buffer.h" | 22 #include "net/base/io_buffer.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // Throttle updates to the UI thread so that a fast moving download doesn't | 26 // Throttle updates to the UI thread so that a fast moving download doesn't |
27 // cause it to become unresponsive (in milliseconds). | 27 // cause it to become unresponsive (in milliseconds). |
28 const int kUpdatePeriodMs = 500; | 28 const int kUpdatePeriodMs = 500; |
29 | 29 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 << " id = " << global_id | 430 << " id = " << global_id |
431 << " download_file = " << download_file->DebugString(); | 431 << " download_file = " << download_file->DebugString(); |
432 | 432 |
433 downloads_.erase(global_id); | 433 downloads_.erase(global_id); |
434 | 434 |
435 delete download_file; | 435 delete download_file; |
436 | 436 |
437 if (downloads_.empty()) | 437 if (downloads_.empty()) |
438 StopUpdateTimer(); | 438 StopUpdateTimer(); |
439 } | 439 } |
OLD | NEW |