| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_remover.h" | 5 #include "chrome/browser/browsing_data_remover.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 BrowserThread::IO, FROM_HERE, | 253 BrowserThread::IO, FROM_HERE, |
| 254 NewRunnableMethod(this, &BrowsingDataRemover::ClearCacheOnIOThread)); | 254 NewRunnableMethod(this, &BrowsingDataRemover::ClearCacheOnIOThread)); |
| 255 } | 255 } |
| 256 | 256 |
| 257 if (remove_mask & REMOVE_LSO_DATA) { | 257 if (remove_mask & REMOVE_LSO_DATA) { |
| 258 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); | 258 UserMetrics::RecordAction(UserMetricsAction("ClearBrowsingData_LSOData")); |
| 259 | 259 |
| 260 waiting_for_clear_lso_data_ = true; | 260 waiting_for_clear_lso_data_ = true; |
| 261 if (!plugin_data_remover_.get()) | 261 if (!plugin_data_remover_.get()) |
| 262 plugin_data_remover_ = new PluginDataRemover(); | 262 plugin_data_remover_ = new PluginDataRemover(); |
| 263 plugin_data_remover_->StartRemoving( | 263 base::WaitableEvent* event = |
| 264 delete_begin_, | 264 plugin_data_remover_->StartRemoving(delete_begin_); |
| 265 NewRunnableMethod(this, &BrowsingDataRemover::OnClearedPluginData)); | 265 watcher_.StartWatching(event, this); |
| 266 } | 266 } |
| 267 | 267 |
| 268 NotifyAndDeleteIfDone(); | 268 NotifyAndDeleteIfDone(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void BrowsingDataRemover::AddObserver(Observer* observer) { | 271 void BrowsingDataRemover::AddObserver(Observer* observer) { |
| 272 observer_list_.AddObserver(observer); | 272 observer_list_.AddObserver(observer); |
| 273 } | 273 } |
| 274 | 274 |
| 275 void BrowsingDataRemover::RemoveObserver(Observer* observer) { | 275 void BrowsingDataRemover::RemoveObserver(Observer* observer) { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 | 502 |
| 503 ChromeAppCacheService* BrowsingDataRemover::GetAppCacheService() { | 503 ChromeAppCacheService* BrowsingDataRemover::GetAppCacheService() { |
| 504 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 504 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 505 ChromeURLRequestContext* request_context = | 505 ChromeURLRequestContext* request_context = |
| 506 reinterpret_cast<ChromeURLRequestContext*>( | 506 reinterpret_cast<ChromeURLRequestContext*>( |
| 507 request_context_getter_->GetURLRequestContext()); | 507 request_context_getter_->GetURLRequestContext()); |
| 508 return request_context ? request_context->appcache_service() | 508 return request_context ? request_context->appcache_service() |
| 509 : NULL; | 509 : NULL; |
| 510 } | 510 } |
| 511 | 511 |
| 512 void BrowsingDataRemover::OnClearedPluginData() { | 512 void BrowsingDataRemover::OnWaitableEventSignaled( |
| 513 base::WaitableEvent* waitable_event) { |
| 513 waiting_for_clear_lso_data_ = false; | 514 waiting_for_clear_lso_data_ = false; |
| 514 NotifyAndDeleteIfDone(); | 515 NotifyAndDeleteIfDone(); |
| 515 } | 516 } |
| OLD | NEW |