Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: content/browser/download/save_package.cc

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/save_package.h" 5 #include "content/browser/download/save_package.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 1087
1088 if (!data.empty()) { 1088 if (!data.empty()) {
1089 // Prepare buffer for saving HTML data. 1089 // Prepare buffer for saving HTML data.
1090 scoped_refptr<net::IOBuffer> new_data(new net::IOBuffer(data.size())); 1090 scoped_refptr<net::IOBuffer> new_data(new net::IOBuffer(data.size()));
1091 memcpy(new_data->data(), data.data(), data.size()); 1091 memcpy(new_data->data(), data.data(), data.size());
1092 1092
1093 // Call write file functionality in file thread. 1093 // Call write file functionality in file thread.
1094 BrowserThread::PostTask( 1094 BrowserThread::PostTask(
1095 BrowserThread::FILE, FROM_HERE, 1095 BrowserThread::FILE, FROM_HERE,
1096 base::Bind(&SaveFileManager::UpdateSaveProgress, file_manager_, 1096 base::Bind(&SaveFileManager::UpdateSaveProgress, file_manager_,
1097 save_item->id(), new_data, static_cast<int>(data.size()))); 1097 save_item->id(), base::RetainedRef(new_data),
1098 static_cast<int>(data.size())));
1098 } 1099 }
1099 1100
1100 // Current frame is completed saving, call finish in file thread. 1101 // Current frame is completed saving, call finish in file thread.
1101 if (end_of_data) { 1102 if (end_of_data) {
1102 DVLOG(20) << " " << __FUNCTION__ << "()" 1103 DVLOG(20) << " " << __FUNCTION__ << "()"
1103 << " save_item_id = " << save_item->id() << " url = \"" 1104 << " save_item_id = " << save_item->id() << " url = \""
1104 << save_item->url().spec() << "\""; 1105 << save_item->url().spec() << "\"";
1105 BrowserThread::PostTask( 1106 BrowserThread::PostTask(
1106 BrowserThread::FILE, FROM_HERE, 1107 BrowserThread::FILE, FROM_HERE,
1107 base::Bind(&SaveFileManager::SaveFinished, file_manager_, 1108 base::Bind(&SaveFileManager::SaveFinished, file_manager_,
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 1520
1520 void SavePackage::FinalizeDownloadEntry() { 1521 void SavePackage::FinalizeDownloadEntry() {
1521 DCHECK(download_); 1522 DCHECK(download_);
1522 DCHECK(download_manager_); 1523 DCHECK(download_manager_);
1523 1524
1524 download_manager_->OnSavePackageSuccessfullyFinished(download_); 1525 download_manager_->OnSavePackageSuccessfullyFinished(download_);
1525 StopObservation(); 1526 StopObservation();
1526 } 1527 }
1527 1528
1528 } // namespace content 1529 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/save_file_resource_handler.cc ('k') | content/browser/indexed_db/indexed_db_quota_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698