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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc

Issue 71233003: [SyncFS] Delete local file on rename and reorganize completion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@00_completion
Patch Set: Created 7 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 unified diff | Download patch
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/drive_backend_util.h" 5 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 base::FilePath temp_file_path; 111 base::FilePath temp_file_path;
112 if (!file_util::CreateTemporaryFile(&temp_file_path)) 112 if (!file_util::CreateTemporaryFile(&temp_file_path))
113 return webkit_blob::ScopedFile(); 113 return webkit_blob::ScopedFile();
114 114
115 return webkit_blob::ScopedFile( 115 return webkit_blob::ScopedFile(
116 temp_file_path, 116 temp_file_path,
117 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, 117 webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT,
118 base::MessageLoopProxy::current().get()); 118 base::MessageLoopProxy::current().get());
119 } 119 }
120 120
121 bool HasFileAsParent(const FileDetails& details, const std::string& file_id) {
122 for (int i = 0; i < details.parent_folder_ids_size(); ++i) {
123 if (details.parent_folder_ids(i) == file_id)
124 return true;
125 }
126 return false;
127 }
128
121 } // namespace drive_backend 129 } // namespace drive_backend
122 } // namespace sync_file_system 130 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698