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

Side by Side Diff: components/offline_pages/offline_page_model_impl.cc

Issue 2512073002: [Offline Pages] Removes two-step expiration related. (Closed)
Patch Set: adding unit in histograms. Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/offline_pages/offline_page_model_impl.h" 5 #include "components/offline_pages/offline_page_model_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 373
374 void OfflinePageModelImpl::MarkPageAccessed(int64_t offline_id) { 374 void OfflinePageModelImpl::MarkPageAccessed(int64_t offline_id) {
375 RunWhenLoaded(base::Bind(&OfflinePageModelImpl::MarkPageAccessedWhenLoadDone, 375 RunWhenLoaded(base::Bind(&OfflinePageModelImpl::MarkPageAccessedWhenLoadDone,
376 weak_ptr_factory_.GetWeakPtr(), offline_id)); 376 weak_ptr_factory_.GetWeakPtr(), offline_id));
377 } 377 }
378 378
379 void OfflinePageModelImpl::MarkPageAccessedWhenLoadDone(int64_t offline_id) { 379 void OfflinePageModelImpl::MarkPageAccessedWhenLoadDone(int64_t offline_id) {
380 DCHECK(is_loaded_); 380 DCHECK(is_loaded_);
381 381
382 auto iter = offline_pages_.find(offline_id); 382 auto iter = offline_pages_.find(offline_id);
383 if (iter == offline_pages_.end() || iter->second.IsExpired()) 383 if (iter == offline_pages_.end())
384 return; 384 return;
385 385
386 // Make a copy of the cached item and update it. The cached item should only 386 // Make a copy of the cached item and update it. The cached item should only
387 // be updated upon the successful store operation. 387 // be updated upon the successful store operation.
388 OfflinePageItem offline_page_item = iter->second; 388 OfflinePageItem offline_page_item = iter->second;
389 389
390 ReportPageHistogramsAfterAccess(offline_page_item, GetCurrentTime()); 390 ReportPageHistogramsAfterAccess(offline_page_item, GetCurrentTime());
391 391
392 offline_page_item.last_access_time = GetCurrentTime(); 392 offline_page_item.last_access_time = GetCurrentTime();
393 offline_page_item.access_count++; 393 offline_page_item.access_count++;
(...skipping 13 matching lines...) Expand all
407 } 407 }
408 408
409 void OfflinePageModelImpl::DoDeletePagesByOfflineId( 409 void OfflinePageModelImpl::DoDeletePagesByOfflineId(
410 const std::vector<int64_t>& offline_ids, 410 const std::vector<int64_t>& offline_ids,
411 const DeletePageCallback& callback) { 411 const DeletePageCallback& callback) {
412 DCHECK(is_loaded_); 412 DCHECK(is_loaded_);
413 413
414 std::vector<base::FilePath> paths_to_delete; 414 std::vector<base::FilePath> paths_to_delete;
415 for (const auto& offline_id : offline_ids) { 415 for (const auto& offline_id : offline_ids) {
416 auto iter = offline_pages_.find(offline_id); 416 auto iter = offline_pages_.find(offline_id);
417 if (iter != offline_pages_.end() && !iter->second.IsExpired()) { 417 if (iter != offline_pages_.end()) {
418 paths_to_delete.push_back(iter->second.file_path); 418 paths_to_delete.push_back(iter->second.file_path);
419 } 419 }
420 } 420 }
421 421
422 // If there're no pages to delete, return early. 422 // If there're no pages to delete, return early.
423 if (paths_to_delete.empty()) { 423 if (paths_to_delete.empty()) {
424 InformDeletePageDone(callback, DeletePageResult::SUCCESS); 424 InformDeletePageDone(callback, DeletePageResult::SUCCESS);
425 return; 425 return;
426 } 426 }
427 427
428 archive_manager_->DeleteMultipleArchives( 428 archive_manager_->DeleteMultipleArchives(
429 paths_to_delete, 429 paths_to_delete,
430 base::Bind(&OfflinePageModelImpl::OnDeleteArchiveFilesDone, 430 base::Bind(&OfflinePageModelImpl::OnDeleteArchiveFilesDone,
431 weak_ptr_factory_.GetWeakPtr(), offline_ids, callback)); 431 weak_ptr_factory_.GetWeakPtr(), offline_ids, callback));
432 } 432 }
433 433
434 void OfflinePageModelImpl::DeletePagesByClientIds( 434 void OfflinePageModelImpl::DeletePagesByClientIds(
435 const std::vector<ClientId>& client_ids, 435 const std::vector<ClientId>& client_ids,
436 const DeletePageCallback& callback) { 436 const DeletePageCallback& callback) {
437 OfflinePageModelQueryBuilder builder; 437 OfflinePageModelQueryBuilder builder;
438 builder 438 builder.SetClientIds(OfflinePageModelQuery::Requirement::INCLUDE_MATCHING,
439 .SetClientIds(OfflinePageModelQuery::Requirement::INCLUDE_MATCHING, 439 client_ids);
440 client_ids)
441 .AllowExpiredPages(true);
442 auto delete_pages = base::Bind(&OfflinePageModelImpl::DeletePages, 440 auto delete_pages = base::Bind(&OfflinePageModelImpl::DeletePages,
443 weak_ptr_factory_.GetWeakPtr(), callback); 441 weak_ptr_factory_.GetWeakPtr(), callback);
444 RunWhenLoaded(base::Bind( 442 RunWhenLoaded(base::Bind(
445 &OfflinePageModelImpl::GetPagesMatchingQueryWhenLoadDone, 443 &OfflinePageModelImpl::GetPagesMatchingQueryWhenLoadDone,
446 weak_ptr_factory_.GetWeakPtr(), 444 weak_ptr_factory_.GetWeakPtr(),
447 base::Passed(builder.Build(GetPolicyController())), delete_pages)); 445 base::Passed(builder.Build(GetPolicyController())), delete_pages));
448 } 446 }
449 447
450 void OfflinePageModelImpl::DeletePages( 448 void OfflinePageModelImpl::DeletePages(
451 const DeletePageCallback& callback, 449 const DeletePageCallback& callback,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 542
545 void OfflinePageModelImpl::GetAllPages( 543 void OfflinePageModelImpl::GetAllPages(
546 const MultipleOfflinePageItemCallback& callback) { 544 const MultipleOfflinePageItemCallback& callback) {
547 OfflinePageModelQueryBuilder builder; 545 OfflinePageModelQueryBuilder builder;
548 RunWhenLoaded( 546 RunWhenLoaded(
549 base::Bind(&OfflinePageModelImpl::GetPagesMatchingQueryWhenLoadDone, 547 base::Bind(&OfflinePageModelImpl::GetPagesMatchingQueryWhenLoadDone,
550 weak_ptr_factory_.GetWeakPtr(), 548 weak_ptr_factory_.GetWeakPtr(),
551 base::Passed(builder.Build(GetPolicyController())), callback)); 549 base::Passed(builder.Build(GetPolicyController())), callback));
552 } 550 }
553 551
554 void OfflinePageModelImpl::GetAllPagesWithExpired(
555 const MultipleOfflinePageItemCallback& callback) {
556 OfflinePageModelQueryBuilder builder;
557 builder.AllowExpiredPages(true);
558
559 RunWhenLoaded(
560 base::Bind(&OfflinePageModelImpl::GetPagesMatchingQueryWhenLoadDone,
561 weak_ptr_factory_.GetWeakPtr(),
562 base::Passed(builder.Build(GetPolicyController())), callback));
563 }
564
565 void OfflinePageModelImpl::GetOfflineIdsForClientId( 552 void OfflinePageModelImpl::GetOfflineIdsForClientId(
566 const ClientId& client_id, 553 const ClientId& client_id,
567 const MultipleOfflineIdCallback& callback) { 554 const MultipleOfflineIdCallback& callback) {
568 RunWhenLoaded( 555 RunWhenLoaded(
569 base::Bind(&OfflinePageModelImpl::GetOfflineIdsForClientIdWhenLoadDone, 556 base::Bind(&OfflinePageModelImpl::GetOfflineIdsForClientIdWhenLoadDone,
570 weak_ptr_factory_.GetWeakPtr(), client_id, callback)); 557 weak_ptr_factory_.GetWeakPtr(), client_id, callback));
571 } 558 }
572 559
573 void OfflinePageModelImpl::GetOfflineIdsForClientIdWhenLoadDone( 560 void OfflinePageModelImpl::GetOfflineIdsForClientIdWhenLoadDone(
574 const ClientId& client_id, 561 const ClientId& client_id,
575 const MultipleOfflineIdCallback& callback) const { 562 const MultipleOfflineIdCallback& callback) const {
576 DCHECK(is_loaded_); 563 DCHECK(is_loaded_);
577 callback.Run(MaybeGetOfflineIdsForClientId(client_id)); 564 callback.Run(MaybeGetOfflineIdsForClientId(client_id));
578 } 565 }
579 566
580 const std::vector<int64_t> OfflinePageModelImpl::MaybeGetOfflineIdsForClientId( 567 const std::vector<int64_t> OfflinePageModelImpl::MaybeGetOfflineIdsForClientId(
581 const ClientId& client_id) const { 568 const ClientId& client_id) const {
582 DCHECK(is_loaded_); 569 DCHECK(is_loaded_);
583 std::vector<int64_t> results; 570 std::vector<int64_t> results;
584 571
585 // We want only all pages, including those marked for deletion. 572 // We want only all pages, including those marked for deletion.
586 // TODO(fgorski): actually use an index rather than linear scan. 573 // TODO(fgorski): actually use an index rather than linear scan.
587 for (const auto& id_page_pair : offline_pages_) { 574 for (const auto& id_page_pair : offline_pages_) {
588 if (id_page_pair.second.client_id == client_id && 575 if (id_page_pair.second.client_id == client_id)
589 !id_page_pair.second.IsExpired()) {
590 results.push_back(id_page_pair.second.offline_id); 576 results.push_back(id_page_pair.second.offline_id);
591 }
592 } 577 }
593 return results; 578 return results;
594 } 579 }
595 580
596 void OfflinePageModelImpl::GetPageByOfflineId( 581 void OfflinePageModelImpl::GetPageByOfflineId(
597 int64_t offline_id, 582 int64_t offline_id,
598 const SingleOfflinePageItemCallback& callback) { 583 const SingleOfflinePageItemCallback& callback) {
599 std::vector<int64_t> query_ids; 584 std::vector<int64_t> query_ids;
600 query_ids.emplace_back(offline_id); 585 query_ids.emplace_back(offline_id);
601 586
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 DCHECK(is_loaded_); 623 DCHECK(is_loaded_);
639 std::vector<OfflinePageItem> result; 624 std::vector<OfflinePageItem> result;
640 625
641 GURL::Replacements remove_params; 626 GURL::Replacements remove_params;
642 remove_params.ClearRef(); 627 remove_params.ClearRef();
643 628
644 GURL url_without_fragment = 629 GURL url_without_fragment =
645 url.ReplaceComponents(remove_params); 630 url.ReplaceComponents(remove_params);
646 631
647 for (const auto& id_page_pair : offline_pages_) { 632 for (const auto& id_page_pair : offline_pages_) {
648 if (id_page_pair.second.IsExpired())
649 continue;
650 // First, search by last committed URL with fragment stripped. 633 // First, search by last committed URL with fragment stripped.
651 if (url_without_fragment == 634 if (url_without_fragment ==
652 id_page_pair.second.url.ReplaceComponents(remove_params)) { 635 id_page_pair.second.url.ReplaceComponents(remove_params)) {
653 result.push_back(id_page_pair.second); 636 result.push_back(id_page_pair.second);
654 continue; 637 continue;
655 } 638 }
656 // Then, search by original request URL if |url_search_mode| wants it. 639 // Then, search by original request URL if |url_search_mode| wants it.
657 // Note that we want to do the exact match with fragment included. This is 640 // Note that we want to do the exact match with fragment included. This is
658 // because original URL is used for redirect purpose and it is always safer 641 // because original URL is used for redirect purpose and it is always safer
659 // to support the exact redirect. 642 // to support the exact redirect.
660 if (url_search_mode == URLSearchMode::SEARCH_BY_ALL_URLS && 643 if (url_search_mode == URLSearchMode::SEARCH_BY_ALL_URLS &&
661 url == id_page_pair.second.original_url) { 644 url == id_page_pair.second.original_url) {
662 result.push_back(id_page_pair.second); 645 result.push_back(id_page_pair.second);
663 } 646 }
664 } 647 }
665 648
666 callback.Run(result); 649 callback.Run(result);
667 } 650 }
668 651
669 void OfflinePageModelImpl::CheckMetadataConsistency() { 652 void OfflinePageModelImpl::CheckMetadataConsistency() {
670 archive_manager_->GetAllArchives( 653 archive_manager_->GetAllArchives(
671 base::Bind(&OfflinePageModelImpl::CheckMetadataConsistencyForArchivePaths, 654 base::Bind(&OfflinePageModelImpl::CheckMetadataConsistencyForArchivePaths,
672 weak_ptr_factory_.GetWeakPtr())); 655 weak_ptr_factory_.GetWeakPtr()));
673 } 656 }
674 657
675 void OfflinePageModelImpl::ExpirePages(
676 const std::vector<int64_t>& offline_ids,
677 const base::Time& expiration_time,
678 const base::Callback<void(bool)>& callback) {
679 std::vector<base::FilePath> paths_to_delete;
680 std::vector<OfflinePageItem> items_to_update;
681 for (int64_t offline_id : offline_ids) {
682 auto iter = offline_pages_.find(offline_id);
683 if (iter == offline_pages_.end())
684 continue;
685
686 OfflinePageItem offline_page = iter->second;
687 paths_to_delete.push_back(offline_page.file_path);
688 offline_page.expiration_time = expiration_time;
689
690 items_to_update.push_back(offline_page);
691 }
692
693 store_->UpdateOfflinePages(
694 items_to_update,
695 base::Bind(&OfflinePageModelImpl::OnExpirePageDone,
696 weak_ptr_factory_.GetWeakPtr(), expiration_time));
697
698 if (paths_to_delete.empty()) {
699 callback.Run(true);
700 return;
701 }
702 archive_manager_->DeleteMultipleArchives(paths_to_delete, callback);
703 }
704
705 void OfflinePageModelImpl::OnExpirePageDone(
706 const base::Time& expiration_time,
707 std::unique_ptr<OfflinePagesUpdateResult> result) {
708 UMA_HISTOGRAM_BOOLEAN("OfflinePages.ExpirePage.StoreUpdateResult",
709 result->updated_items.size() > 0);
710 for (const auto& expired_page : result->updated_items) {
711 const auto& iter = offline_pages_.find(expired_page.offline_id);
712 if (iter == offline_pages_.end())
713 continue;
714
715 iter->second.expiration_time = expiration_time;
716 ClientId client_id = iter->second.client_id;
717 offline_event_logger_.RecordPageExpired(
718 std::to_string(expired_page.offline_id));
719 base::HistogramBase* histogram = base::Histogram::FactoryGet(
720 AddHistogramSuffix(client_id, "OfflinePages.ExpirePage.PageLifetime"),
721 1, base::TimeDelta::FromDays(30).InMinutes(), 50,
722 base::HistogramBase::kUmaTargetedHistogramFlag);
723 histogram->Add((expiration_time - iter->second.creation_time).InMinutes());
724 histogram = base::Histogram::FactoryGet(
725 AddHistogramSuffix(client_id,
726 "OfflinePages.ExpirePage.TimeSinceLastAccess"),
727 1, base::TimeDelta::FromDays(30).InMinutes(), 50,
728 base::HistogramBase::kUmaTargetedHistogramFlag);
729 histogram->Add(
730 (expiration_time - iter->second.last_access_time).InMinutes());
731 }
732 }
733
734 ClientPolicyController* OfflinePageModelImpl::GetPolicyController() { 658 ClientPolicyController* OfflinePageModelImpl::GetPolicyController() {
735 return policy_controller_.get(); 659 return policy_controller_.get();
736 } 660 }
737 661
738 OfflinePageMetadataStore* OfflinePageModelImpl::GetStoreForTesting() { 662 OfflinePageMetadataStore* OfflinePageModelImpl::GetStoreForTesting() {
739 return store_.get(); 663 return store_.get();
740 } 664 }
741 665
742 OfflinePageStorageManager* OfflinePageModelImpl::GetStorageManager() { 666 OfflinePageStorageManager* OfflinePageModelImpl::GetStorageManager() {
743 return storage_manager_.get(); 667 return storage_manager_.get();
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 static_cast<int>(result), 962 static_cast<int>(result),
1039 static_cast<int>(DeletePageResult::RESULT_COUNT)); 963 static_cast<int>(DeletePageResult::RESULT_COUNT));
1040 archive_manager_->GetStorageStats( 964 archive_manager_->GetStorageStats(
1041 base::Bind(&ReportStorageHistogramsAfterDelete)); 965 base::Bind(&ReportStorageHistogramsAfterDelete));
1042 if (!callback.is_null()) 966 if (!callback.is_null())
1043 callback.Run(result); 967 callback.Run(result);
1044 } 968 }
1045 969
1046 void OfflinePageModelImpl::CheckMetadataConsistencyForArchivePaths( 970 void OfflinePageModelImpl::CheckMetadataConsistencyForArchivePaths(
1047 const std::set<base::FilePath>& archive_paths) { 971 const std::set<base::FilePath>& archive_paths) {
1048 ExpirePagesMissingArchiveFile(archive_paths); 972 DeletePagesMissingArchiveFile(archive_paths);
1049 DeleteOrphanedArchives(archive_paths); 973 DeleteOrphanedArchives(archive_paths);
1050 } 974 }
1051 975
1052 void OfflinePageModelImpl::ExpirePagesMissingArchiveFile( 976 void OfflinePageModelImpl::DeletePagesMissingArchiveFile(
1053 const std::set<base::FilePath>& archive_paths) { 977 const std::set<base::FilePath>& archive_paths) {
1054 std::vector<int64_t> ids_of_pages_missing_archive_file; 978 std::vector<int64_t> ids_of_pages_missing_archive_file;
1055 for (const auto& id_page_pair : offline_pages_) { 979 for (const auto& id_page_pair : offline_pages_) {
1056 if (archive_paths.count(id_page_pair.second.file_path) == 0UL) 980 if (archive_paths.count(id_page_pair.second.file_path) == 0UL)
1057 ids_of_pages_missing_archive_file.push_back(id_page_pair.first); 981 ids_of_pages_missing_archive_file.push_back(id_page_pair.first);
1058 } 982 }
1059 983
1060 if (ids_of_pages_missing_archive_file.empty()) 984 if (ids_of_pages_missing_archive_file.empty())
1061 return; 985 return;
1062 986
1063 ExpirePages( 987 DeletePagesByOfflineId(
1064 ids_of_pages_missing_archive_file, GetCurrentTime(), 988 ids_of_pages_missing_archive_file,
1065 base::Bind(&OfflinePageModelImpl::OnExpirePagesMissingArchiveFileDone, 989 base::Bind(&OfflinePageModelImpl::OnDeletePagesMissingArchiveFileDone,
1066 weak_ptr_factory_.GetWeakPtr(), 990 weak_ptr_factory_.GetWeakPtr(),
1067 ids_of_pages_missing_archive_file)); 991 ids_of_pages_missing_archive_file));
1068 } 992 }
1069 993
1070 void OfflinePageModelImpl::OnExpirePagesMissingArchiveFileDone( 994 void OfflinePageModelImpl::OnDeletePagesMissingArchiveFileDone(
1071 const std::vector<int64_t>& offline_ids, 995 const std::vector<int64_t>& offline_ids,
1072 bool success) { 996 DeletePageResult result) {
1073 UMA_HISTOGRAM_COUNTS("OfflinePages.Consistency.PagesMissingArchiveFileCount", 997 UMA_HISTOGRAM_COUNTS("OfflinePages.Consistency.PagesMissingArchiveFileCount",
1074 static_cast<int32_t>(offline_ids.size())); 998 static_cast<int32_t>(offline_ids.size()));
1075 UMA_HISTOGRAM_BOOLEAN( 999 UMA_HISTOGRAM_ENUMERATION(
1076 "OfflinePages.Consistency.ExpirePagesMissingArchiveFileResult", success); 1000 "OfflinePages.Consistency.DeletePagesMissingArchiveFileResult",
1001 static_cast<int>(result),
1002 static_cast<int>(DeletePageResult::RESULT_COUNT));
1077 } 1003 }
1078 1004
1079 void OfflinePageModelImpl::DeleteOrphanedArchives( 1005 void OfflinePageModelImpl::DeleteOrphanedArchives(
1080 const std::set<base::FilePath>& archive_paths) { 1006 const std::set<base::FilePath>& archive_paths) {
1081 // Archives are considered orphaned unless they are pointed to by some pages. 1007 // Archives are considered orphaned unless they are pointed to by some pages.
1082 std::set<base::FilePath> orphaned_archive_set(archive_paths); 1008 std::set<base::FilePath> orphaned_archive_set(archive_paths);
1083 for (const auto& id_page_pair : offline_pages_) 1009 for (const auto& id_page_pair : offline_pages_)
1084 orphaned_archive_set.erase(id_page_pair.second.file_path); 1010 orphaned_archive_set.erase(id_page_pair.second.file_path);
1085 1011
1086 if (orphaned_archive_set.empty()) 1012 if (orphaned_archive_set.empty())
(...skipping 26 matching lines...) Expand all
1113 void OfflinePageModelImpl::ClearStorageIfNeeded( 1039 void OfflinePageModelImpl::ClearStorageIfNeeded(
1114 const ClearStorageCallback& callback) { 1040 const ClearStorageCallback& callback) {
1115 // Create Storage Manager if necessary. 1041 // Create Storage Manager if necessary.
1116 if (!storage_manager_) { 1042 if (!storage_manager_) {
1117 storage_manager_.reset(new OfflinePageStorageManager( 1043 storage_manager_.reset(new OfflinePageStorageManager(
1118 this, GetPolicyController(), archive_manager_.get())); 1044 this, GetPolicyController(), archive_manager_.get()));
1119 } 1045 }
1120 storage_manager_->ClearPagesIfNeeded(callback); 1046 storage_manager_->ClearPagesIfNeeded(callback);
1121 } 1047 }
1122 1048
1123 void OfflinePageModelImpl::OnStorageCleared(size_t expired_page_count, 1049 void OfflinePageModelImpl::OnStorageCleared(size_t deleted_page_count,
1124 ClearStorageResult result) { 1050 ClearStorageResult result) {
1125 UMA_HISTOGRAM_ENUMERATION("OfflinePages.ClearStorageResult", 1051 UMA_HISTOGRAM_ENUMERATION("OfflinePages.ClearStorageResult",
1126 static_cast<int>(result), 1052 static_cast<int>(result),
1127 static_cast<int>(ClearStorageResult::RESULT_COUNT)); 1053 static_cast<int>(ClearStorageResult::RESULT_COUNT));
1128 if (expired_page_count > 0) { 1054 if (deleted_page_count > 0) {
1129 UMA_HISTOGRAM_COUNTS("OfflinePages.ExpirePage.BatchSize", 1055 UMA_HISTOGRAM_COUNTS("OfflinePages.ClearStorageBatchSize",
1130 static_cast<int32_t>(expired_page_count)); 1056 static_cast<int32_t>(deleted_page_count));
1131 } 1057 }
1132 } 1058 }
1133 1059
1134 void OfflinePageModelImpl::PostClearStorageIfNeededTask(bool delayed) { 1060 void OfflinePageModelImpl::PostClearStorageIfNeededTask(bool delayed) {
1135 base::TimeDelta delay = 1061 base::TimeDelta delay =
1136 delayed ? kStorageManagerStartingDelay : base::TimeDelta(); 1062 delayed ? kStorageManagerStartingDelay : base::TimeDelta();
1137 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 1063 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
1138 FROM_HERE, base::Bind(&OfflinePageModelImpl::ClearStorageIfNeeded, 1064 FROM_HERE, base::Bind(&OfflinePageModelImpl::ClearStorageIfNeeded,
1139 weak_ptr_factory_.GetWeakPtr(), 1065 weak_ptr_factory_.GetWeakPtr(),
1140 base::Bind(&OfflinePageModelImpl::OnStorageCleared, 1066 base::Bind(&OfflinePageModelImpl::OnStorageCleared,
(...skipping 14 matching lines...) Expand all
1155 } 1081 }
1156 1082
1157 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); 1083 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task);
1158 } 1084 }
1159 1085
1160 base::Time OfflinePageModelImpl::GetCurrentTime() const { 1086 base::Time OfflinePageModelImpl::GetCurrentTime() const {
1161 return testing_clock_ ? testing_clock_->Now() : base::Time::Now(); 1087 return testing_clock_ ? testing_clock_->Now() : base::Time::Now();
1162 } 1088 }
1163 1089
1164 } // namespace offline_pages 1090 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_model_impl.h ('k') | components/offline_pages/offline_page_model_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698