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

Unified Diff: chrome/browser/android/data_usage/external_data_use_observer_bridge.cc

Issue 1772273002: Remove one thread hop while fetching matching rules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 9 months 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/data_usage/external_data_use_observer_bridge.cc
diff --git a/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc b/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc
index 63e49661b8afda4599d288df6109992e2e8f4885..9ef7a35af7cb67921102eaccf1b1979d6b2c2e5d 100644
--- a/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc
+++ b/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc
@@ -172,7 +172,19 @@ void ExternalDataUseObserverBridge::OnControlAppInstallStateChange(
jobject obj,
bool is_control_app_installed) const {
DCHECK(thread_checker_.CalledOnValidThread());
- data_use_tab_model_->OnControlAppInstallStateChange(is_control_app_installed);
+ if (data_use_tab_model_) {
+ data_use_tab_model_->OnControlAppInstallStateChange(
+ is_control_app_installed);
+ }
+}
+
+void ExternalDataUseObserverBridge::ShouldRegisterAsDataUseObserver(
+ bool should_register) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ io_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&ExternalDataUseObserver::ShouldRegisterAsDataUseObserver,
+ external_data_use_observer_, should_register));
}
bool RegisterExternalDataUseObserver(JNIEnv* env) {

Powered by Google App Engine
This is Rietveld 408576698