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

Unified Diff: chrome/browser/android/offline_pages/evaluation/evaluation_test_scheduler.cc

Issue 2529603004: [Offline Pages] Expanding event logger to be used by harness. (Closed)
Patch Set: more comments. 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 side-by-side diff with in-line comments
Download patch
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..82626edfc917bcfb4c89cb08855ec6bfec5c974d 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 {
@@ -19,6 +20,8 @@ namespace android {
namespace {
+const char kLogTag[] = "EvaluationTestScheduler";
+
void StartProcessing();
void ProcessingDoneCallback(bool result) {
@@ -51,6 +54,16 @@ void StartProcessing() {
void EvaluationTestScheduler::Schedule(
const TriggerConditions& trigger_conditions) {
+ Profile* profile = ProfileManager::GetLastUsedProfile();
+ if (!coordinator_) {
+ coordinator_ =
+ RequestCoordinatorFactory::GetInstance()->GetForBrowserContext(profile);
+ // It's not expected that the coordinator would be nullptr since this bridge
+ // would only be used for testing scenario.
+ DCHECK(coordinator_);
+ }
+ coordinator_->GetLogger()->RecordActivity(std::string(kLogTag) +
+ " Start schedule!");
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
base::Bind(&StartProcessing));
}

Powered by Google App Engine
This is Rietveld 408576698