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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend_v1/api_util.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/sync_file_system/drive_backend_v1/api_util.h" 5 #include "chrome/browser/sync_file_system/drive_backend_v1/api_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <sstream> 9 #include <sstream>
10 #include <string> 10 #include <string>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 std::string mime_type; 137 std::string mime_type;
138 if (extension.empty() || 138 if (extension.empty() ||
139 !net::GetWellKnownMimeTypeFromExtension(extension.substr(1), &mime_type)) 139 !net::GetWellKnownMimeTypeFromExtension(extension.substr(1), &mime_type))
140 return kMimeTypeOctetStream; 140 return kMimeTypeOctetStream;
141 return mime_type; 141 return mime_type;
142 } 142 }
143 143
144 bool CreateTemporaryFile(const base::FilePath& dir_path, 144 bool CreateTemporaryFile(const base::FilePath& dir_path,
145 webkit_blob::ScopedFile* temp_file) { 145 webkit_blob::ScopedFile* temp_file) {
146 base::FilePath temp_file_path; 146 base::FilePath temp_file_path;
147 const bool success = file_util::CreateDirectory(dir_path) && 147 const bool success = base::CreateDirectory(dir_path) &&
148 base::CreateTemporaryFileInDir(dir_path, &temp_file_path); 148 base::CreateTemporaryFileInDir(dir_path, &temp_file_path);
149 if (!success) 149 if (!success)
150 return success; 150 return success;
151 *temp_file = 151 *temp_file =
152 webkit_blob::ScopedFile(temp_file_path, 152 webkit_blob::ScopedFile(temp_file_path,
153 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, 153 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT,
154 base::MessageLoopProxy::current().get()); 154 base::MessageLoopProxy::current().get());
155 return success; 155 return success;
156 } 156 }
157 157
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 } 1144 }
1145 1145
1146 std::string APIUtil::GetRootResourceId() const { 1146 std::string APIUtil::GetRootResourceId() const {
1147 if (IsDriveAPIDisabled()) 1147 if (IsDriveAPIDisabled())
1148 return drive_service_->GetRootResourceId(); 1148 return drive_service_->GetRootResourceId();
1149 return root_resource_id_; 1149 return root_resource_id_;
1150 } 1150 }
1151 1151
1152 } // namespace drive_backend 1152 } // namespace drive_backend
1153 } // namespace sync_file_system 1153 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698