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

Side by Side Diff: chrome/browser/sync/invalidations/invalidator_storage.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/glue/synced_session.h ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/invalidations/invalidator_storage.h" 5 #include "chrome/browser/sync/invalidations/invalidator_storage.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 void InvalidatorStorage::SetBootstrapData(const std::string& data) { 276 void InvalidatorStorage::SetBootstrapData(const std::string& data) {
277 DCHECK(thread_checker_.CalledOnValidThread()); 277 DCHECK(thread_checker_.CalledOnValidThread());
278 std::string base64_data; 278 std::string base64_data;
279 base::Base64Encode(data, &base64_data); 279 base::Base64Encode(data, &base64_data);
280 pref_service_->SetString(prefs::kInvalidatorInvalidationState, 280 pref_service_->SetString(prefs::kInvalidatorInvalidationState,
281 base64_data); 281 base64_data);
282 } 282 }
283 283
284 std::string InvalidatorStorage::GetBootstrapData() const { 284 std::string InvalidatorStorage::GetBootstrapData() const {
285 std::string base64_data(pref_service_ ? 285 std::string base64_data(
286 pref_service_->GetString(prefs::kInvalidatorInvalidationState) : ""); 286 pref_service_
287 ? pref_service_->GetString(prefs::kInvalidatorInvalidationState)
288 : std::string());
287 std::string data; 289 std::string data;
288 base::Base64Decode(base64_data, &data); 290 base::Base64Decode(base64_data, &data);
289 return data; 291 return data;
290 } 292 }
291 293
292 void InvalidatorStorage::Clear() { 294 void InvalidatorStorage::Clear() {
293 DCHECK(thread_checker_.CalledOnValidThread()); 295 DCHECK(thread_checker_.CalledOnValidThread());
294 pref_service_->ClearPref(prefs::kInvalidatorMaxInvalidationVersions); 296 pref_service_->ClearPref(prefs::kInvalidatorMaxInvalidationVersions);
295 pref_service_->ClearPref(prefs::kInvalidatorClientId); 297 pref_service_->ClearPref(prefs::kInvalidatorClientId);
296 pref_service_->ClearPref(prefs::kInvalidatorInvalidationState); 298 pref_service_->ClearPref(prefs::kInvalidatorInvalidationState);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 return; 335 return;
334 it->second.current = ack_handle; 336 it->second.current = ack_handle;
335 337
336 base::ListValue state_map_list; 338 base::ListValue state_map_list;
337 SerializeToList(state_map, &state_map_list); 339 SerializeToList(state_map, &state_map_list);
338 pref_service_->Set(prefs::kInvalidatorMaxInvalidationVersions, 340 pref_service_->Set(prefs::kInvalidatorMaxInvalidationVersions,
339 state_map_list); 341 state_map_list);
340 } 342 }
341 343
342 } // namespace browser_sync 344 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/synced_session.h ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698