OLD | NEW |
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/drag_download_util.h" | 5 #include "content/browser/download/drag_download_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 new_file_path = file_path->InsertBeforeExtension(suffix); | 75 new_file_path = file_path->InsertBeforeExtension(suffix); |
76 } | 76 } |
77 | 77 |
78 // http://crbug.com/110709 | 78 // http://crbug.com/110709 |
79 base::ThreadRestrictions::ScopedAllowIO allow_io; | 79 base::ThreadRestrictions::ScopedAllowIO allow_io; |
80 | 80 |
81 base::File file( | 81 base::File file( |
82 new_file_path, base::File::FLAG_CREATE | base::File::FLAG_WRITE); | 82 new_file_path, base::File::FLAG_CREATE | base::File::FLAG_WRITE); |
83 if (file.IsValid()) { | 83 if (file.IsValid()) { |
84 *file_path = new_file_path; | 84 *file_path = new_file_path; |
85 return file.Pass(); | 85 return file; |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 return base::File(); | 89 return base::File(); |
90 } | 90 } |
91 | 91 |
92 PromiseFileFinalizer::PromiseFileFinalizer( | 92 PromiseFileFinalizer::PromiseFileFinalizer( |
93 DragDownloadFile* drag_file_downloader) | 93 DragDownloadFile* drag_file_downloader) |
94 : drag_file_downloader_(drag_file_downloader) { | 94 : drag_file_downloader_(drag_file_downloader) { |
95 } | 95 } |
(...skipping 12 matching lines...) Expand all Loading... |
108 } | 108 } |
109 | 109 |
110 PromiseFileFinalizer::~PromiseFileFinalizer() {} | 110 PromiseFileFinalizer::~PromiseFileFinalizer() {} |
111 | 111 |
112 void PromiseFileFinalizer::Cleanup() { | 112 void PromiseFileFinalizer::Cleanup() { |
113 if (drag_file_downloader_.get()) | 113 if (drag_file_downloader_.get()) |
114 drag_file_downloader_ = NULL; | 114 drag_file_downloader_ = NULL; |
115 } | 115 } |
116 | 116 |
117 } // namespace content | 117 } // namespace content |
OLD | NEW |