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

Unified Diff: components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc

Issue 2729983002: Attaches OfflineContentAggregator to Profile (Closed)
Patch Set: Address nit Created 3 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: components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
diff --git a/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc b/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
index 52cca1872fa4d7ff92b144d99eb786e17d54369f..70184f92a2ed6d210c10f9b7567d4995b0b4a756 100644
--- a/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
+++ b/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
@@ -36,16 +36,18 @@ bool OfflineContentAggregatorBridge::Register(JNIEnv* env) {
}
// static
-OfflineContentAggregatorBridge*
-OfflineContentAggregatorBridge::GetForOfflineContentAggregator(
+base::android::ScopedJavaLocalRef<jobject>
+OfflineContentAggregatorBridge::GetBridgeForOfflineContentAggregator(
OfflineContentAggregator* aggregator) {
if (!aggregator->GetUserData(kOfflineContentAggregatorBridgeUserDataKey)) {
aggregator->SetUserData(kOfflineContentAggregatorBridgeUserDataKey,
new OfflineContentAggregatorBridge(aggregator));
}
+ OfflineContentAggregatorBridge* bridge =
+ static_cast<OfflineContentAggregatorBridge*>(
+ aggregator->GetUserData(kOfflineContentAggregatorBridgeUserDataKey));
- return static_cast<OfflineContentAggregatorBridge*>(
- aggregator->GetUserData(kOfflineContentAggregatorBridgeUserDataKey));
+ return ScopedJavaLocalRef<jobject>(bridge->java_ref_);
}
OfflineContentAggregatorBridge::OfflineContentAggregatorBridge(

Powered by Google App Engine
This is Rietveld 408576698