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

Side by Side Diff: chrome/browser/chromeos/profiles/profile_helper.cc

Issue 2175703002: Implement a task scheduler for BrowsingDataRemover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bdr-race-condition
Patch Set: Formatting. 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/chromeos/profiles/profile_helper.h" 5 #include "chrome/browser/chromeos/profiles/profile_helper.h"
6 6
7 #include "base/barrier_closure.h" 7 #include "base/barrier_closure.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 base::BarrierClosure(2, base::Bind(&ProfileHelper::OnSigninProfileCleared, 255 base::BarrierClosure(2, base::Bind(&ProfileHelper::OnSigninProfileCleared,
256 weak_factory_.GetWeakPtr())); 256 weak_factory_.GetWeakPtr()));
257 257
258 ProfileManager* profile_manager = g_browser_process->profile_manager(); 258 ProfileManager* profile_manager = g_browser_process->profile_manager();
259 // Check if signin profile was loaded. 259 // Check if signin profile was loaded.
260 if (profile_manager->GetProfileByPath(GetSigninProfileDir())) { 260 if (profile_manager->GetProfileByPath(GetSigninProfileDir())) {
261 LOG_ASSERT(!browsing_data_remover_); 261 LOG_ASSERT(!browsing_data_remover_);
262 browsing_data_remover_ = 262 browsing_data_remover_ =
263 BrowsingDataRemoverFactory::GetForBrowserContext(GetSigninProfile()); 263 BrowsingDataRemoverFactory::GetForBrowserContext(GetSigninProfile());
264 browsing_data_remover_->AddObserver(this); 264 browsing_data_remover_->AddObserver(this);
265 browsing_data_remover_->Remove(BrowsingDataRemover::Unbounded(), 265 browsing_data_remover_->RemoveAndReply(
266 BrowsingDataRemover::REMOVE_SITE_DATA, 266 BrowsingDataRemover::Unbounded(), BrowsingDataRemover::REMOVE_SITE_DATA,
267 BrowsingDataHelper::ALL); 267 BrowsingDataHelper::ALL, this);
268 } else { 268 } else {
269 on_clear_profile_stage_finished_.Run(); 269 on_clear_profile_stage_finished_.Run();
270 } 270 }
271 271
272 if (content::StoragePartition* partition = login::GetSigninPartition()) { 272 if (content::StoragePartition* partition = login::GetSigninPartition()) {
273 partition->ClearData( 273 partition->ClearData(
274 content::StoragePartition::REMOVE_DATA_MASK_ALL, 274 content::StoragePartition::REMOVE_DATA_MASK_ALL,
275 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, GURL(), 275 content::StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, GURL(),
276 content::StoragePartition::OriginMatcherFunction(), base::Time(), 276 content::StoragePartition::OriginMatcherFunction(), base::Time(),
277 base::Time::Now(), on_clear_profile_stage_finished_); 277 base::Time::Now(), on_clear_profile_stage_finished_);
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 DownloadPrefs::FromBrowserContext(profile)->DownloadPath()); 490 DownloadPrefs::FromBrowserContext(profile)->DownloadPath());
491 // Let extension system handle extension files. 491 // Let extension system handle extension files.
492 excludes.push_back(base::FilePath(extensions::kInstallDirectoryName)); 492 excludes.push_back(base::FilePath(extensions::kInstallDirectoryName));
493 // Do not flush Drive cache. 493 // Do not flush Drive cache.
494 excludes.push_back(base::FilePath(chromeos::kDriveCacheDirname)); 494 excludes.push_back(base::FilePath(chromeos::kDriveCacheDirname));
495 495
496 profile_flusher_->RequestFlush(profile->GetPath(), excludes, base::Closure()); 496 profile_flusher_->RequestFlush(profile->GetPath(), excludes, base::Closure());
497 } 497 }
498 498
499 } // namespace chromeos 499 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698