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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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/drag_download_util.h" 5 #include "content/browser/download/drag_download_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 std::string suffix = std::string("-") + base::IntToString(seq); 75 std::string suffix = std::string("-") + base::IntToString(seq);
76 #endif 76 #endif
77 new_file_path = file_path->InsertBeforeExtension(suffix); 77 new_file_path = file_path->InsertBeforeExtension(suffix);
78 } 78 }
79 79
80 // http://crbug.com/110709 80 // http://crbug.com/110709
81 base::ThreadRestrictions::ScopedAllowIO allow_io; 81 base::ThreadRestrictions::ScopedAllowIO allow_io;
82 82
83 // Explicitly (and redundantly check) for file -- despite the fact that our 83 // Explicitly (and redundantly check) for file -- despite the fact that our
84 // open won't overwrite -- just to avoid log spew. 84 // open won't overwrite -- just to avoid log spew.
85 if (!file_util::PathExists(new_file_path) && 85 if (!base::PathExists(new_file_path) &&
86 file_stream->OpenSync(new_file_path, base::PLATFORM_FILE_CREATE | 86 file_stream->OpenSync(new_file_path, base::PLATFORM_FILE_CREATE |
87 base::PLATFORM_FILE_WRITE) == net::OK) { 87 base::PLATFORM_FILE_WRITE) == net::OK) {
88 *file_path = new_file_path; 88 *file_path = new_file_path;
89 return file_stream.release(); 89 return file_stream.release();
90 } 90 }
91 } 91 }
92 92
93 return NULL; 93 return NULL;
94 } 94 }
95 95
(...skipping 16 matching lines...) Expand all
112 } 112 }
113 113
114 PromiseFileFinalizer::~PromiseFileFinalizer() {} 114 PromiseFileFinalizer::~PromiseFileFinalizer() {}
115 115
116 void PromiseFileFinalizer::Cleanup() { 116 void PromiseFileFinalizer::Cleanup() {
117 if (drag_file_downloader_.get()) 117 if (drag_file_downloader_.get())
118 drag_file_downloader_ = NULL; 118 drag_file_downloader_ = NULL;
119 } 119 }
120 120
121 } // namespace content 121 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_file_unittest.cc ('k') | content/browser/download/save_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698