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

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

Issue 2648213004: Migrate --enable-arc and --arc-available part 1. (Closed)
Patch Set: address comments. Created 3 years, 11 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
« no previous file with comments | « components/arc/arc_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eae327e796ebed0849ee3b2c21ac07b65a1e27af..18a29c3495d81ac53260964171153b898bf77edc 100644
--- a/components/arc/intent_helper/arc_intent_helper_bridge.cc
+++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/arc_service_manager.h"
+#include "components/arc/arc_util.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"
@@ -133,7 +134,14 @@ ArcIntentHelperBridge::FilterOutIntentHelper(
bool ArcIntentHelperBridge::IsIntentHelperAvailable(GetResult* out_error_code) {
auto* arc_service_manager = ArcServiceManager::Get();
if (!arc_service_manager) {
- if (!ArcBridgeService::GetEnabled(base::CommandLine::ForCurrentProcess())) {
+ // TODO(hidehiko): IsArcAvailable() looks not the condition to be checked
+ // here, because ArcServiceManager instance is created regardless of ARC
+ // availability. This happens only before MessageLoop starts or after
+ // MessageLoop stops, practically.
+ // Also, returning FAILED_ARC_NOT_READY looks problematic at the moment,
+ // because ArcProcessTask::StartIconLoading accesses to
+ // ArcServiceManager::Get() return value, which can be nullptr.
+ if (!IsArcAvailable()) {
VLOG(2) << "ARC bridge is not supported.";
if (out_error_code)
*out_error_code = GetResult::FAILED_ARC_NOT_SUPPORTED;
« no previous file with comments | « components/arc/arc_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698