OLD | NEW |
1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/download/save_file_manager.h" | 7 #include "chrome/browser/download/save_file_manager.h" |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/stl_util-inl.h" | 11 #include "base/stl_util-inl.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 347 |
348 // Notifications sent from the UI thread and run on the IO thread. | 348 // Notifications sent from the UI thread and run on the IO thread. |
349 | 349 |
350 void SaveFileManager::OnSaveURL( | 350 void SaveFileManager::OnSaveURL( |
351 const GURL& url, | 351 const GURL& url, |
352 const GURL& referrer, | 352 const GURL& referrer, |
353 int render_process_host_id, | 353 int render_process_host_id, |
354 int render_view_id, | 354 int render_view_id, |
355 URLRequestContextGetter* request_context_getter) { | 355 URLRequestContextGetter* request_context_getter) { |
356 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 356 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
357 URLRequestContext* context = request_context_getter->GetURLRequestContext(); | 357 net::URLRequestContext* context = |
| 358 request_context_getter->GetURLRequestContext(); |
358 resource_dispatcher_host_->BeginSaveFile(url, | 359 resource_dispatcher_host_->BeginSaveFile(url, |
359 referrer, | 360 referrer, |
360 render_process_host_id, | 361 render_process_host_id, |
361 render_view_id, | 362 render_view_id, |
362 context); | 363 context); |
363 } | 364 } |
364 | 365 |
365 void SaveFileManager::OnRequireSaveJobFromOtherSource( | 366 void SaveFileManager::OnRequireSaveJobFromOtherSource( |
366 SaveFileCreateInfo* info) { | 367 SaveFileCreateInfo* info) { |
367 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 368 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 SaveFileMap::iterator it = save_file_map_.find(*i); | 524 SaveFileMap::iterator it = save_file_map_.find(*i); |
524 if (it != save_file_map_.end()) { | 525 if (it != save_file_map_.end()) { |
525 SaveFile* save_file = it->second; | 526 SaveFile* save_file = it->second; |
526 DCHECK(!save_file->in_progress()); | 527 DCHECK(!save_file->in_progress()); |
527 file_util::Delete(save_file->full_path(), false); | 528 file_util::Delete(save_file->full_path(), false); |
528 delete save_file; | 529 delete save_file; |
529 save_file_map_.erase(it); | 530 save_file_map_.erase(it); |
530 } | 531 } |
531 } | 532 } |
532 } | 533 } |
OLD | NEW |