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

Unified Diff: base/files/file_util_mac.mm

Issue 603683005: base::CopyFile can copy *from* Android's content scheme. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base::internal::CopyFileUnsafe -> base::CopyFile Created 6 years, 1 month 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 | « base/files/file_util.cc ('k') | base/files/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_util_mac.mm
diff --git a/base/files/file_util_mac.mm b/base/files/file_util_mac.mm
index 695935a2e31fe162b1690b1b3d28f60c4e09d732..acac8d738ea1d52e68e70be9c7e4357816d72807 100644
--- a/base/files/file_util_mac.mm
+++ b/base/files/file_util_mac.mm
@@ -14,16 +14,15 @@
#include "base/threading/thread_restrictions.h"
namespace base {
-namespace internal {
-bool CopyFileUnsafe(const FilePath& from_path, const FilePath& to_path) {
+bool CopyFile(const FilePath& from_path, const FilePath& to_path) {
ThreadRestrictions::AssertIOAllowed();
+ if (from_path.ReferencesParent() || to_path.ReferencesParent())
+ return false;
return (copyfile(from_path.value().c_str(),
to_path.value().c_str(), NULL, COPYFILE_DATA) == 0);
}
-} // namespace internal
-
bool GetTempDir(base::FilePath* path) {
NSString* tmp = NSTemporaryDirectory();
if (tmp == nil)
« no previous file with comments | « base/files/file_util.cc ('k') | base/files/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698