| 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 "chrome/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 "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/download/download_create_info.h" | |
| 14 #include "chrome/browser/download/download_manager.h" | |
| 15 #include "chrome/browser/download/download_request_handle.h" | |
| 16 #include "chrome/browser/download/download_util.h" | 13 #include "chrome/browser/download/download_util.h" |
| 17 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 16 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 20 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 21 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
| 19 #include "content/browser/download/download_create_info.h" |
| 20 #include "content/browser/download/download_manager.h" |
| 22 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 21 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 23 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
| 24 #include "googleurl/src/gurl.h" | 23 #include "googleurl/src/gurl.h" |
| 25 #include "net/base/io_buffer.h" | 24 #include "net/base/io_buffer.h" |
| 26 | 25 |
| 27 namespace { | 26 namespace { |
| 28 | 27 |
| 29 // Throttle updates to the UI thread so that a fast moving download doesn't | 28 // Throttle updates to the UI thread so that a fast moving download doesn't |
| 30 // cause it to become unresponsive (in milliseconds). | 29 // cause it to become unresponsive (in milliseconds). |
| 31 const int kUpdatePeriodMs = 500; | 30 const int kUpdatePeriodMs = 500; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 << " id = " << id | 394 << " id = " << id |
| 396 << " download_file = " << download_file->DebugString(); | 395 << " download_file = " << download_file->DebugString(); |
| 397 | 396 |
| 398 downloads_.erase(id); | 397 downloads_.erase(id); |
| 399 | 398 |
| 400 delete download_file; | 399 delete download_file; |
| 401 | 400 |
| 402 if (downloads_.empty()) | 401 if (downloads_.empty()) |
| 403 StopUpdateTimer(); | 402 StopUpdateTimer(); |
| 404 } | 403 } |
| OLD | NEW |