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

Side by Side Diff: chrome/browser/sync/profile_sync_service_android.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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/profile_sync_service_android.h" 5 #include "chrome/browser/sync/profile_sync_service_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 return sync_service_->HasUnrecoverableError(); 434 return sync_service_->HasUnrecoverableError();
435 } 435 }
436 436
437 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest( 437 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest(
438 JNIEnv* env, jobject) { 438 JNIEnv* env, jobject) {
439 DCHECK_CURRENTLY_ON(BrowserThread::UI); 439 DCHECK_CURRENTLY_ON(BrowserThread::UI);
440 440
441 scoped_ptr<base::DictionaryValue> about_info = 441 scoped_ptr<base::DictionaryValue> about_info =
442 sync_ui_util::ConstructAboutInformation(sync_service_); 442 sync_ui_util::ConstructAboutInformation(sync_service_);
443 std::string about_info_json; 443 std::string about_info_json;
444 base::JSONWriter::Write(about_info.get(), &about_info_json); 444 base::JSONWriter::Write(*about_info, &about_info_json);
445 445
446 return ConvertUTF8ToJavaString(env, about_info_json); 446 return ConvertUTF8ToJavaString(env, about_info_json);
447 } 447 }
448 448
449 jlong ProfileSyncServiceAndroid::GetLastSyncedTimeForTest( 449 jlong ProfileSyncServiceAndroid::GetLastSyncedTimeForTest(
450 JNIEnv* env, jobject obj) { 450 JNIEnv* env, jobject obj) {
451 // Use profile preferences here instead of SyncPrefs to avoid an extra 451 // Use profile preferences here instead of SyncPrefs to avoid an extra
452 // conversion, since SyncPrefs::GetLastSyncedTime() converts the stored value 452 // conversion, since SyncPrefs::GetLastSyncedTime() converts the stored value
453 // to to base::Time. 453 // to to base::Time.
454 return static_cast<jlong>( 454 return static_cast<jlong>(
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 ProfileSyncServiceAndroid* profile_sync_service_android = 541 ProfileSyncServiceAndroid* profile_sync_service_android =
542 new ProfileSyncServiceAndroid(env, obj); 542 new ProfileSyncServiceAndroid(env, obj);
543 profile_sync_service_android->Init(); 543 profile_sync_service_android->Init();
544 return reinterpret_cast<intptr_t>(profile_sync_service_android); 544 return reinterpret_cast<intptr_t>(profile_sync_service_android);
545 } 545 }
546 546
547 // static 547 // static
548 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { 548 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) {
549 return RegisterNativesImpl(env); 549 return RegisterNativesImpl(env);
550 } 550 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698