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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover.cc

Issue 12094106: Refactor: Simplify WaitableEventWatcher. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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) 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/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // check the origin_set_mask_ to prevent unintended deletion. 411 // check the origin_set_mask_ to prevent unintended deletion.
412 if (remove_mask & REMOVE_PLUGIN_DATA && 412 if (remove_mask & REMOVE_PLUGIN_DATA &&
413 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { 413 origin_set_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) {
414 content::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); 414 content::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData"));
415 415
416 waiting_for_clear_plugin_data_ = true; 416 waiting_for_clear_plugin_data_ = true;
417 if (!plugin_data_remover_.get()) 417 if (!plugin_data_remover_.get())
418 plugin_data_remover_.reset(content::PluginDataRemover::Create(profile_)); 418 plugin_data_remover_.reset(content::PluginDataRemover::Create(profile_));
419 base::WaitableEvent* event = 419 base::WaitableEvent* event =
420 plugin_data_remover_->StartRemoving(delete_begin_); 420 plugin_data_remover_->StartRemoving(delete_begin_);
421 watcher_.StartWatching(event, this); 421
422 base::WaitableEventWatcher::EventCallback watcher_callback =
423 base::Bind(&BrowsingDataRemover::OnWaitableEventSignaled,
424 base::Unretained(this));
425 watcher_.StartWatching(event, watcher_callback);
422 } 426 }
423 #endif 427 #endif
424 428
425 if (remove_mask & REMOVE_PASSWORDS) { 429 if (remove_mask & REMOVE_PASSWORDS) {
426 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords")); 430 content::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords"));
427 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( 431 PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
428 profile_, Profile::EXPLICIT_ACCESS); 432 profile_, Profile::EXPLICIT_ACCESS);
429 433
430 if (password_store) 434 if (password_store)
431 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_); 435 password_store->RemoveLoginsCreatedBetween(delete_begin_, delete_end_);
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 BrowserThread::UI, FROM_HERE, 1020 BrowserThread::UI, FROM_HERE,
1017 base::Bind(&BrowsingDataRemover::OnClearedFormData, 1021 base::Bind(&BrowsingDataRemover::OnClearedFormData,
1018 base::Unretained(this))); 1022 base::Unretained(this)));
1019 } 1023 }
1020 1024
1021 void BrowsingDataRemover::OnClearedFormData() { 1025 void BrowsingDataRemover::OnClearedFormData() {
1022 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1026 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1023 waiting_for_clear_form_ = false; 1027 waiting_for_clear_form_ = false;
1024 NotifyAndDeleteIfDone(); 1028 NotifyAndDeleteIfDone();
1025 } 1029 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698