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

Side by Side Diff: chrome/browser/sync/glue/preference_model_associator.cc

Issue 5577003: Coverity: Pass parameters by reference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 10 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/glue/preference_model_associator.h" 5 #include "chrome/browser/sync/glue/preference_model_associator.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 return false; 159 return false;
160 } 160 }
161 161
162 // The sync model has user created nodes if the preferences folder has any 162 // The sync model has user created nodes if the preferences folder has any
163 // children. 163 // children.
164 *has_nodes = sync_api::kInvalidId != preferences_node.GetFirstChildId(); 164 *has_nodes = sync_api::kInvalidId != preferences_node.GetFirstChildId();
165 return true; 165 return true;
166 } 166 }
167 167
168 int64 PreferenceModelAssociator::GetSyncIdFromChromeId( 168 int64 PreferenceModelAssociator::GetSyncIdFromChromeId(
169 const std::string preference_name) { 169 const std::string& preference_name) {
170 PreferenceNameToSyncIdMap::const_iterator iter = 170 PreferenceNameToSyncIdMap::const_iterator iter =
171 id_map_.find(preference_name); 171 id_map_.find(preference_name);
172 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; 172 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second;
173 } 173 }
174 174
175 void PreferenceModelAssociator::Associate( 175 void PreferenceModelAssociator::Associate(
176 const PrefService::Preference* preference, int64 sync_id) { 176 const PrefService::Preference* preference, int64 sync_id) {
177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
178 DCHECK_NE(sync_api::kInvalidId, sync_id); 178 DCHECK_NE(sync_api::kInvalidId, sync_id);
179 DCHECK(id_map_.find(preference->name()) == id_map_.end()); 179 DCHECK(id_map_.find(preference->name()) == id_map_.end());
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // notification to update the UI. 307 // notification to update the UI.
308 if (0 == pref_name.compare(prefs::kShowBookmarkBar)) { 308 if (0 == pref_name.compare(prefs::kShowBookmarkBar)) {
309 NotificationService::current()->Notify( 309 NotificationService::current()->Notify(
310 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, 310 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
311 Source<PreferenceModelAssociator>(this), 311 Source<PreferenceModelAssociator>(this),
312 NotificationService::NoDetails()); 312 NotificationService::NoDetails());
313 } 313 }
314 } 314 }
315 315
316 } // namespace browser_sync 316 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/preference_model_associator.h ('k') | chrome/browser/sync/glue/session_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698