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

Unified Diff: components/arc/intent_helper/arc_intent_helper_bridge.cc

Issue 2557513004: Remove explicit singletonness of ArcBridgeService part 3. (Closed)
Patch Set: 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: components/arc/intent_helper/arc_intent_helper_bridge.cc
diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.cc b/components/arc/intent_helper/arc_intent_helper_bridge.cc
index 0851be627b6ff012e6d7a3d10a6c8c4016d1574b..9e202d15c8f32218290d7051d8cc881df1b388ef 100644
--- a/components/arc/intent_helper/arc_intent_helper_bridge.cc
+++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc
@@ -14,6 +14,7 @@
#include "base/command_line.h"
#include "base/memory/weak_ptr.h"
#include "components/arc/arc_bridge_service.h"
+#include "components/arc/arc_service_manager.h"
#include "components/arc/intent_helper/activity_icon_loader.h"
#include "components/arc/intent_helper/link_handler_model_impl.h"
#include "components/arc/intent_helper/local_activity_resolver.h"
@@ -130,8 +131,8 @@ ArcIntentHelperBridge::GetIntentHelperInstanceWithErrorCode(
const std::string& method_name_for_logging,
uint32_t min_instance_version,
GetResult* out_error_code) {
- ArcBridgeService* bridge_service = ArcBridgeService::Get();
- if (!bridge_service) {
+ auto* arc_service_manager = ArcServiceManager::Get();
+ if (!arc_service_manager) {
if (!ArcBridgeService::GetEnabled(base::CommandLine::ForCurrentProcess())) {
VLOG(2) << "ARC bridge is not supported.";
if (out_error_code)
@@ -144,15 +145,17 @@ ArcIntentHelperBridge::GetIntentHelperInstanceWithErrorCode(
return nullptr;
}
- if (!bridge_service->intent_helper()->has_instance()) {
+ auto* intent_helper =
Luis Héctor Chávez 2016/12/06 18:55:00 nit: maybe intent_helper_holder? instance_holder?
hidehiko 2016/12/06 19:11:28 Thank you for suggestion. Replaced by intent_helpe
+ arc_service_manager->arc_bridge_service()->intent_helper();
+ if (!intent_helper->has_instance()) {
VLOG(2) << "ARC intent helper instance is not ready.";
if (out_error_code)
*out_error_code = GetResult::FAILED_ARC_NOT_READY;
return nullptr;
}
- auto* instance = bridge_service->intent_helper()->GetInstanceForMethod(
- method_name_for_logging, min_instance_version);
+ auto* instance = intent_helper->GetInstanceForMethod(method_name_for_logging,
+ min_instance_version);
if (!instance) {
if (out_error_code)
*out_error_code = GetResult::FAILED_ARC_NOT_SUPPORTED;

Powered by Google App Engine
This is Rietveld 408576698