Chromium Code Reviews| Index: chrome/browser/android/offline_pages/evaluation/evaluation_test_scheduler.cc |
| diff --git a/chrome/browser/android/offline_pages/evaluation/evaluation_test_scheduler.cc b/chrome/browser/android/offline_pages/evaluation/evaluation_test_scheduler.cc |
| index 03eabe2c009a32681cfb69e136185ccbb1f37b4e..8b824c7c8645b23fdd100352de0f034631a8700c 100644 |
| --- a/chrome/browser/android/offline_pages/evaluation/evaluation_test_scheduler.cc |
| +++ b/chrome/browser/android/offline_pages/evaluation/evaluation_test_scheduler.cc |
| @@ -11,6 +11,7 @@ |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "components/offline_pages/background/device_conditions.h" |
| #include "components/offline_pages/background/request_coordinator.h" |
| +#include "components/offline_pages/offline_event_logger.h" |
| #include "net/base/network_change_notifier.h" |
| namespace offline_pages { |
| @@ -51,6 +52,13 @@ void StartProcessing() { |
| void EvaluationTestScheduler::Schedule( |
| const TriggerConditions& trigger_conditions) { |
| + Profile* profile = ProfileManager::GetLastUsedProfile(); |
| + if (!coordinator_) { |
|
fgorski
2016/11/30 17:30:47
Since you only use this here, I don't think you ne
romax
2016/12/01 01:47:52
Acknowledged.
yeah but this schedule might be call
|
| + coordinator_ = |
| + RequestCoordinatorFactory::GetInstance()->GetForBrowserContext(profile); |
|
fgorski
2016/11/30 17:30:47
what if your profile is null here, or incognito, a
romax
2016/12/01 01:47:52
I didn't think about this case since this schedule
fgorski
2016/12/01 21:42:52
Go ahead.
romax
2016/12/02 01:57:48
Done.
|
| + } |
| + coordinator_->GetLogger()->RecordActivity(OFFLINE_LOG_TAG + |
| + "Start schedule!"); |
| base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| base::Bind(&StartProcessing)); |
| } |