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

Unified Diff: chrome/browser/chromeos/arc/arc_wallpaper_service.cc

Issue 2347293002: arc: Add InstanceHelper::GetInstanceForMethod() (Closed)
Patch Set: No more DCHECK Created 4 years, 3 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/chromeos/arc/arc_wallpaper_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_wallpaper_service.cc b/chrome/browser/chromeos/arc/arc_wallpaper_service.cc
index 9321f4a43ccabdb789c5581aa2c0560a6f02d7bd..bbd169e494aa1810d259a1012d1e6254f98984b9 100644
--- a/chrome/browser/chromeos/arc/arc_wallpaper_service.cc
+++ b/chrome/browser/chromeos/arc/arc_wallpaper_service.cc
@@ -141,27 +141,12 @@ void ArcWallpaperService::OnDecodeImageFailed() {
void ArcWallpaperService::OnWallpaperDataChanged() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- mojom::WallpaperInstance* instance =
- GetWallpaperInstance(kMinOnWallpaperChangedVersion);
- if (!instance)
+ auto* wallpaper_instance =
+ arc_bridge_service()->wallpaper()->GetInstanceForMethod(
+ "OnWallpaperChanged", kMinOnWallpaperChangedVersion);
+ if (!wallpaper_instance)
return;
- instance->OnWallpaperChanged();
-}
-
-mojom::WallpaperInstance* ArcWallpaperService::GetWallpaperInstance(
- uint32_t min_version) {
- uint32_t version = arc_bridge_service()->wallpaper()->version();
- if (version < min_version) {
- VLOG(1) << "ARC wallpaper instance is too old. required: " << min_version
- << ", actual: " << version;
- return nullptr;
- }
-
- mojom::WallpaperInstance* instance =
- arc_bridge_service()->wallpaper()->instance();
- if (!instance)
- VLOG(2) << "ARC wallpaper instance is not ready.";
- return instance;
+ wallpaper_instance->OnWallpaperChanged();
}
} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/arc_wallpaper_service.h ('k') | chrome/browser/task_manager/providers/arc/arc_process_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698