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

Unified Diff: content/browser/web_contents/web_drag_source_mac.mm

Issue 11028131: Shift passage of FileStream in downloads system to be by scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated Al's comments. Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_drag_source_gtk.cc ('k') | content/public/browser/download_save_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_drag_source_mac.mm
diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm
index 8cccff57a478d956c2fb7c252b3e432a0671a62a..3de112db33ec0f6aed449ba9e5cf22dda3e677f1 100644
--- a/content/browser/web_contents/web_drag_source_mac.mm
+++ b/content/browser/web_contents/web_drag_source_mac.mm
@@ -80,7 +80,7 @@ FilePath GetFileNameFromDragData(const WebDropData& drop_data) {
// is responsible for opening the file. It takes the drop data and an open file
// stream.
void PromiseWriterHelper(const WebDropData& drop_data,
- FileStream* file_stream) {
+ scoped_ptr<FileStream> file_stream) {
DCHECK(file_stream);
file_stream->WriteSync(drop_data.file_contents.data(),
drop_data.file_contents.length());
@@ -342,16 +342,16 @@ void PromiseWriterHelper(const WebDropData& drop_data,
// which is blocking. Since this operation is already blocking the
// UI thread on OSX, it should be reasonable to let it happen.
base::ThreadRestrictions::ScopedAllowIO allowIO;
- FileStream* fileStream =
+ scoped_ptr<FileStream> fileStream(
drag_download_util::CreateFileStreamForDrop(
- &filePath, content::GetContentClient()->browser()->GetNetLog());
- if (!fileStream)
+ &filePath, content::GetContentClient()->browser()->GetNetLog()));
+ if (!fileStream.get())
return nil;
if (downloadURL_.is_valid()) {
scoped_refptr<DragDownloadFile> dragFileDownloader(new DragDownloadFile(
filePath,
- linked_ptr<net::FileStream>(fileStream),
+ fileStream.Pass(),
downloadURL_,
content::Referrer(contents_->GetURL(), dropData_->referrer_policy),
contents_->GetEncoding(),
@@ -366,7 +366,7 @@ void PromiseWriterHelper(const WebDropData& drop_data,
FROM_HERE,
base::Bind(&PromiseWriterHelper,
*dropData_,
- base::Owned(fileStream)));
+ base::Passed(fileStream.Pass())));
}
// Once we've created the file, we should return the file name.
« no previous file with comments | « content/browser/web_contents/web_drag_source_gtk.cc ('k') | content/public/browser/download_save_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698