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

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

Issue 2529603004: [Offline Pages] Expanding event logger to be used by harness. (Closed)
Patch Set: Created 4 years, 1 month 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/offline_page_evaluation_bridge.cc
diff --git a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
index 1d138ad90a24d5c4101be3e94e50a174f957f34d..7a3ed4a871cf1430b634e765da0ac7011de6b09d 100644
--- a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
+++ b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
@@ -53,6 +53,7 @@ const bool kPreferRetryCountOverRecency = false;
const int kMaxStartedTries = 4;
const int kMaxCompletedTries = 1;
const int kImmediateRequestExpirationTimeInSeconds = 3600;
+const char kNativeTag[] = "OPNative";
void ToJavaOfflinePageList(JNIEnv* env,
jobject j_result_obj,
@@ -225,6 +226,8 @@ OfflinePageEvaluationBridge::OfflinePageEvaluationBridge(
NotifyIfDoneLoading();
offline_page_model_->AddObserver(this);
request_coordinator_->AddObserver(this);
+ offline_page_model->GetLogger()->SetClient(this);
+ request_coordinator->GetLogger()->SetClient(this);
}
OfflinePageEvaluationBridge::~OfflinePageEvaluationBridge() {
@@ -269,6 +272,13 @@ void OfflinePageEvaluationBridge::OnChanged(const SavePageRequest& request) {
env, java_ref_, ToJavaSavePageRequest(env, request));
}
+void OfflinePageEvaluationBridge::CustomLog(const std::string& message) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_OfflinePageEvaluationBridge_log(env, java_ref_,
+ ConvertUTF8ToJavaString(env, kNativeTag),
+ ConvertUTF8ToJavaString(env, message));
+}
+
void OfflinePageEvaluationBridge::GetAllPages(
JNIEnv* env,
const JavaParamRef<jobject>& obj,

Powered by Google App Engine
This is Rietveld 408576698