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

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

Issue 1372153002: Detecting and fixing stringprintf.h format bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed four mismatches that I missed Created 5 years, 2 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
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/local_to_remote_syncer.h " 5 #include "chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h "
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 DCHECK(active_ancestor_details.file_kind() == FILE_KIND_FILE || 142 DCHECK(active_ancestor_details.file_kind() == FILE_KIND_FILE ||
143 active_ancestor_details.file_kind() == FILE_KIND_FOLDER); 143 active_ancestor_details.file_kind() == FILE_KIND_FOLDER);
144 144
145 base::FilePath missing_entries; 145 base::FilePath missing_entries;
146 if (active_ancestor_path.empty()) { 146 if (active_ancestor_path.empty()) {
147 missing_entries = path; 147 missing_entries = path;
148 } else if (active_ancestor_path != path) { 148 } else if (active_ancestor_path != path) {
149 if (!active_ancestor_path.AppendRelativePath(path, &missing_entries)) { 149 if (!active_ancestor_path.AppendRelativePath(path, &missing_entries)) {
150 NOTREACHED(); 150 NOTREACHED();
151 token->RecordLog(base::StringPrintf( 151 #ifdef OS_WIN
152 "Detected invalid ancestor: %s", 152 // FilePath::StringType is std::wstring on Windows
153 active_ancestor_path.value().c_str())); 153 token->RecordLog(
154 base::StringPrintf("Detected invalid ancestor: %ls",
155 active_ancestor_path.value().c_str()));
156 #else
157 token->RecordLog(
158 base::StringPrintf("Detected invalid ancestor: %s",
159 active_ancestor_path.value().c_str()));
160 #endif
154 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_FAILED); 161 SyncTaskManager::NotifyTaskDone(token.Pass(), SYNC_STATUS_FAILED);
155 return; 162 return;
156 } 163 }
157 } 164 }
158 165
159 std::vector<base::FilePath::StringType> missing_components; 166 std::vector<base::FilePath::StringType> missing_components;
160 storage::VirtualPath::GetComponents(missing_entries, &missing_components); 167 storage::VirtualPath::GetComponents(missing_entries, &missing_components);
161 168
162 if (!missing_components.empty()) { 169 if (!missing_components.empty()) {
163 if (local_is_missing_) { 170 if (local_is_missing_) {
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 set_used_network(true); 766 set_used_network(true);
760 return sync_context_->GetDriveUploader(); 767 return sync_context_->GetDriveUploader();
761 } 768 }
762 769
763 MetadataDatabase* LocalToRemoteSyncer::metadata_database() { 770 MetadataDatabase* LocalToRemoteSyncer::metadata_database() {
764 return sync_context_->GetMetadataDatabase(); 771 return sync_context_->GetMetadataDatabase();
765 } 772 }
766 773
767 } // namespace drive_backend 774 } // namespace drive_backend
768 } // namespace sync_file_system 775 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698