| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 rv = factory->GetCache()->GetBackend(&cache_, &cache_callback_); | 471 rv = factory->GetCache()->GetBackend(&cache_, &cache_callback_); |
| 472 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ? | 472 next_cache_state_ = (next_cache_state_ == STATE_CREATE_MAIN) ? |
| 473 STATE_DELETE_MAIN : STATE_DELETE_MEDIA; | 473 STATE_DELETE_MAIN : STATE_DELETE_MEDIA; |
| 474 break; | 474 break; |
| 475 } | 475 } |
| 476 case STATE_DELETE_MAIN: | 476 case STATE_DELETE_MAIN: |
| 477 case STATE_DELETE_MEDIA: { | 477 case STATE_DELETE_MEDIA: { |
| 478 // |cache_| can be null if it cannot be initialized. | 478 // |cache_| can be null if it cannot be initialized. |
| 479 if (cache_) { | 479 if (cache_) { |
| 480 if (delete_begin_.is_null()) { | 480 if (delete_begin_.is_null()) { |
| 481 rv = cache_->DoomAllEntries(&cache_callback_); | 481 rv = cache_->DoomAllEntries( |
| 482 base::Bind(&BrowsingDataRemover::DoClearCache, |
| 483 base::Unretained(this))); |
| 482 } else { | 484 } else { |
| 483 rv = cache_->DoomEntriesBetween(delete_begin_, delete_end_, | 485 rv = cache_->DoomEntriesBetween( |
| 484 &cache_callback_); | 486 delete_begin_, delete_end_, |
| 487 base::Bind(&BrowsingDataRemover::DoClearCache, |
| 488 base::Unretained(this))); |
| 485 } | 489 } |
| 486 cache_ = NULL; | 490 cache_ = NULL; |
| 487 } | 491 } |
| 488 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? | 492 next_cache_state_ = (next_cache_state_ == STATE_DELETE_MAIN) ? |
| 489 STATE_CREATE_MEDIA : STATE_DONE; | 493 STATE_CREATE_MEDIA : STATE_DONE; |
| 490 break; | 494 break; |
| 491 } | 495 } |
| 492 case STATE_DONE: { | 496 case STATE_DONE: { |
| 493 cache_ = NULL; | 497 cache_ = NULL; |
| 494 | 498 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 GetURLRequestContext()->cookie_store()->GetCookieMonster(); | 622 GetURLRequestContext()->cookie_store()->GetCookieMonster(); |
| 619 if (cookie_monster) { | 623 if (cookie_monster) { |
| 620 cookie_monster->DeleteAllCreatedBetweenAsync( | 624 cookie_monster->DeleteAllCreatedBetweenAsync( |
| 621 delete_begin_, delete_end_, | 625 delete_begin_, delete_end_, |
| 622 base::Bind(&BrowsingDataRemover::OnClearedCookies, | 626 base::Bind(&BrowsingDataRemover::OnClearedCookies, |
| 623 base::Unretained(this))); | 627 base::Unretained(this))); |
| 624 } else { | 628 } else { |
| 625 OnClearedCookies(0); | 629 OnClearedCookies(0); |
| 626 } | 630 } |
| 627 } | 631 } |
| OLD | NEW |