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

Side by Side Diff: chrome/browser/android/signin/signin_manager_android.cc

Issue 2175703002: Implement a task scheduler for BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bdr-race-condition
Patch Set: Created 4 years, 4 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 <vector> 5 #include <vector>
6 6
7 #include "chrome/browser/android/signin/signin_manager_android.h" 7 #include "chrome/browser/android/signin/signin_manager_android.h"
8 8
9 #include "base/android/callback_android.h" 9 #include "base/android/callback_android.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // A BrowsingDataRemover::Observer that clears all Profile data and then 53 // A BrowsingDataRemover::Observer that clears all Profile data and then
54 // invokes a callback and deletes itself. 54 // invokes a callback and deletes itself.
55 class ProfileDataRemover : public BrowsingDataRemover::Observer { 55 class ProfileDataRemover : public BrowsingDataRemover::Observer {
56 public: 56 public:
57 ProfileDataRemover(Profile* profile, const base::Closure& callback) 57 ProfileDataRemover(Profile* profile, const base::Closure& callback)
58 : callback_(callback), 58 : callback_(callback),
59 origin_runner_(base::ThreadTaskRunnerHandle::Get()), 59 origin_runner_(base::ThreadTaskRunnerHandle::Get()),
60 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) { 60 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) {
61 remover_->AddObserver(this); 61 remover_->AddObserver(this);
62 remover_->Remove(BrowsingDataRemover::Unbounded(), 62 remover_->RemoveAndReply(BrowsingDataRemover::Unbounded(),
63 BrowsingDataRemover::REMOVE_ALL, BrowsingDataHelper::ALL); 63 BrowsingDataRemover::REMOVE_ALL,
64 BrowsingDataHelper::ALL,
65 this);
64 } 66 }
65 67
66 ~ProfileDataRemover() override {} 68 ~ProfileDataRemover() override {}
67 69
68 void OnBrowsingDataRemoverDone() override { 70 void OnBrowsingDataRemoverDone() override {
69 remover_->RemoveObserver(this); 71 remover_->RemoveObserver(this);
70 origin_runner_->PostTask(FROM_HERE, callback_); 72 origin_runner_->PostTask(FROM_HERE, callback_);
71 origin_runner_->DeleteSoon(FROM_HERE, this); 73 origin_runner_->DeleteSoon(FROM_HERE, this);
72 } 74 }
73 75
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 const JavaParamRef<jstring>& j_email) { 340 const JavaParamRef<jstring>& j_email) {
339 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email); 341 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email);
340 std::string domain = gaia::ExtractDomainName(email); 342 std::string domain = gaia::ExtractDomainName(email);
341 return base::android::ConvertUTF8ToJavaString(env, domain); 343 return base::android::ConvertUTF8ToJavaString(env, domain);
342 } 344 }
343 345
344 // static 346 // static
345 bool SigninManagerAndroid::Register(JNIEnv* env) { 347 bool SigninManagerAndroid::Register(JNIEnv* env) {
346 return RegisterNativesImpl(env); 348 return RegisterNativesImpl(env);
347 } 349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698