|
|
Created:
4 years, 1 month ago by oka Modified:
4 years ago CC:
chromium-reviews, oka+watch_chromium.org, rginda+watch_chromium.org, mtomasz+watch_chromium.org, yamaguchi+watch_chromium.org, fukino+watch_chromium.org, hidehiko, Daniel Erat Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionNotify Files App when ARC++ app is installed/removed.
This change will later allow Files App to keep apps shown by
"More actions..." in sync with ARC++.
BUG=620577
TEST=
- git cl try
- ninja -j100 -C out/Release components_unittests &&
out/Release/components_unittests --gtest_filter="ArcIntentHelperTest.*"
- Manually tested using Minnie with this CL
https://codereview.chromium.org/2513493002/:
1. Select a PDF file on Files App.
2. Install Kindle.
3. Confirm "more action..." appears on the context menu and Open
button's UI changes to be able to open Kindle.
4. Uninstall Kindle.
5. Confirm "more action..." no longer appears and Open button doesn't
show Kindle up anymore.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/948665d2c9c7f3238ab22e17a44df727a76f747d
Cr-Commit-Position: refs/heads/master@{#435868}
Patch Set 1 #Patch Set 2 : Notify Files App when ARC++ app is updated. #Patch Set 3 : Notify Files App when ARC++ app is installed/removed. #
Total comments: 27
Patch Set 4 : Address comments. #Patch Set 5 : rebase #Patch Set 6 : Fix base. #Patch Set 7 : Added comments to Observer and Get. #Patch Set 8 : nit: OnAppsUpdated -> onAppsUpdated in .idl #Patch Set 9 : Add RemoverObserver. #
Total comments: 4
Patch Set 10 : Update a comment. #Patch Set 11 : wip: updated the construct to chain OnAppsUpdated. #Patch Set 12 : Removed global pointer in arc_intent_helper_bridge and separeted observer class out. #Patch Set 13 : Added observer file for real. #Patch Set 14 : Bug fix: I forgot to add intent_helper to arc_service_manager. #
Total comments: 21
Patch Set 15 : Addressed some comments. #
Total comments: 2
Patch Set 16 : Fixed compile and lint errors and added a test which at least compile. I couldn't figure out how to… #Patch Set 17 : git cl format #Patch Set 18 : Updated the test to pass. #
Total comments: 32
Patch Set 19 : Addressed comments. #
Total comments: 18
Patch Set 20 : Addressed comments. #Patch Set 21 : Rebased. #Patch Set 22 : Removed accidentally added function while rebasing. #
Total comments: 2
Patch Set 23 : Updated histograms.xml. #Patch Set 24 : Fixed BrowserTest.Title. #
Total comments: 2
Patch Set 25 : Add IsInitialized to arc_service_manager. #Dependent Patchsets: Messages
Total messages: 149 (87 generated)
Description was changed from ========== Remove unused variable tasks_ from task_controller. BUG=None TEST=manually tested. ========== to ========== Remove unused variable tasks_ from task_controller. BUG=None TEST=manually tested. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Description was changed from ========== Remove unused variable tasks_ from task_controller. BUG=None TEST=manually tested. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=TBD CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
oka@chromium.org changed reviewers: + fukino@chromium.org, kinaba@chromium.org
PTAL.
kinaba@chromium.org changed reviewers: + hidehiko@chromium.org, yusukes@chromium.org
+hidehiko as arc/ OWNER and +yusukes for ArcIntentHelper author. (Sorry, my review may be slow due to a P0 bug coming up...) https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:506: DCHECK(bridge); When ARC is not enabled (either by config or when the device does not support it at all), |bridge| may be null, IIUC.
initial comment. more to come. https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:40: #include "components/arc/intent_helper/arc_intent_helper_bridge.h" nit: Remove. You can rely on the header file in this case. https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes reads "However, any includes present in the related header do not need to be included again in the related cc (i.e., foo.cc can rely on foo.h's includes)." https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:506: DCHECK(bridge); On 2016/11/17 01:47:19, kinaba wrote: > When ARC is not enabled (either by config or when the device does not support it > at all), > |bridge| may be null, IIUC. > Yeah, and you might have to retry later to avoid introducing a race. I'll comment more on this later. https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:507: bridge->AddObserver(this); AddObserver should almost always be paired with RemoveObserver. For other observer interfaces, EventRouter::Shutdown() seems to call RemoveObserver in the reverse order. Shouldn't we do that too? https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.h (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.h:1: // Copyright (c) 2012 The Chromium Authors. All rights reserved. * Please run git cl try. * Each line in the CL description seems too long. The convention I think is to keep each line less than ~67 characters. https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.h:74: void OnAppsUpdated() override; // arc::ArcIntentHelperBridge::Observer oderrides: to be consistent with L76. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:192: for (auto& observer : observer_list_) { nit: no {} https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.h (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.h:53: }; Don't we need protected: virtual ~Observer() {} ?
https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:506: DCHECK(bridge); On 2016/11/17 02:29:54, Yusuke Sato wrote: > On 2016/11/17 01:47:19, kinaba wrote: > > When ARC is not enabled (either by config or when the device does not support > it > > at all), > > |bridge| may be null, IIUC. > > > > Yeah, and you might have to retry later to avoid introducing a race. I'll > comment more on this later. Sorry I misread your code. ArcIntentHelperBridge instance is created in ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() regardless of whether ARC is supported or not, so you code doesn't seem to have a race. hidehiko: Can |bridge| be nullptr here? I don't remember if ArcServiceManager's Shutdown() is actually called on production code. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid to assume the class is singleton. Adding more global pointers to components/arc/ seems sad. We already have enough. Instead of this, what about the following: * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() * Add [set_]arc_intent_helper_bridge() setter/getter to ArcServiceManager. * Add arc_intent_helper_bridge_ raw pointer (member variable) to ArcServiceManager; * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in ArcIntentHelperBridge's ctor, and ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. * In chrome/browser/, get an ArcIntentHelperBridge instance with ArcServiceManager::Get()->arc_intent_helper_bridge(). ArcServiceManager is already a singleton and has Get() method. The manager also has getters like icon_loader() for allowing chrome/browser/ code to use components/arc/'s objects. The proposal above follows the current way to some extent.
https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:506: DCHECK(bridge); On 2016/11/17 04:22:37, Yusuke Sato wrote: > On 2016/11/17 02:29:54, Yusuke Sato wrote: > > On 2016/11/17 01:47:19, kinaba wrote: > > > When ARC is not enabled (either by config or when the device does not > support > > it > > > at all), > > > |bridge| may be null, IIUC. > > > > > > > Yeah, and you might have to retry later to avoid introducing a race. I'll > > comment more on this later. > > Sorry I misread your code. ArcIntentHelperBridge instance is created in > ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() regardless of whether > ARC is supported or not, so you code doesn't seem to have a race. > > hidehiko: > Can |bridge| be nullptr here? I don't remember if ArcServiceManager's Shutdown() > is actually called on production code. > Can |bridge| be nullptr here? I think no. In past, the launcher creation was guarded by a flag IIRC, but nowadays it is created always. I'm not sure it is ensured in all test cases, though. > I don't remember if ArcServiceManager's Shutdown() > is actually called on production code. It is. https://cs.chromium.org/chromium/src/chrome/browser/chromeos/chrome_browser_m... Note that the Shutdown is called before the BrowserContextKeyedService is destructed. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid to assume the class is singleton. On 2016/11/17 04:22:37, Yusuke Sato wrote: > Adding more global pointers to components/arc/ seems sad. We already have > enough. Instead of this, what about the following: > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > * Add [set_]arc_intent_helper_bridge() setter/getter to ArcServiceManager. > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > ArcServiceManager; > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > ArcIntentHelperBridge's ctor, and > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. > * In chrome/browser/, get an ArcIntentHelperBridge instance with > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > ArcServiceManager is already a singleton and has Get() method. The manager also > has getters like icon_loader() for allowing chrome/browser/ code to use > components/arc/'s objects. The proposal above follows the current way to some > extent. > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in ArcIntentHelperBridge's ctor, and ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. I do not want this. If we'll get rid of global ptr, I prefer calling the setter in ArcServiceLauncher::Initialize() instead. > ArcServiceManager is already a singleton and has Get() method. The manager also > has getters like icon_loader() for allowing chrome/browser/ code to use > components/arc/'s objects. The proposal above follows the current way to some > extent. We have some getters, but those are not for ArcService classes, so this looks something new to me, too. (And that's why I recommended to oka@ san to use global ptr.) https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.h (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.h:52: virtual void OnAppsUpdated() = 0; Document please. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.h:61: static ArcIntentHelperBridge* Get(); It's better to note this is something workaround, and encouraged to avoid as much as possible. Also, could you document when this returns an instance, and when not?
https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:506: DCHECK(bridge); On 2016/11/17 07:34:19, hidehiko wrote: > On 2016/11/17 04:22:37, Yusuke Sato wrote: > > On 2016/11/17 02:29:54, Yusuke Sato wrote: > > > On 2016/11/17 01:47:19, kinaba wrote: > > > > When ARC is not enabled (either by config or when the device does not > > support > > > it > > > > at all), > > > > |bridge| may be null, IIUC. > > > > > > > > > > Yeah, and you might have to retry later to avoid introducing a race. I'll > > > comment more on this later. > > > > Sorry I misread your code. ArcIntentHelperBridge instance is created in > > ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() regardless of whether > > ARC is supported or not, so you code doesn't seem to have a race. > > > > hidehiko: > > Can |bridge| be nullptr here? I don't remember if ArcServiceManager's > Shutdown() > > is actually called on production code. > > > Can |bridge| be nullptr here? > > I think no. In past, the launcher creation was guarded by a flag IIRC, but > nowadays it is created always. I'm not sure it is ensured in all test cases, > though. > > > I don't remember if ArcServiceManager's Shutdown() > > is actually called on production code. > > It is. > https://cs.chromium.org/chromium/src/chrome/browser/chromeos/chrome_browser_m... > > Note that the Shutdown is called before the BrowserContextKeyedService is > destructed. Got it, thanks for refreshing my memory. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid to assume the class is singleton. On 2016/11/17 07:34:19, hidehiko wrote: > On 2016/11/17 04:22:37, Yusuke Sato wrote: > > Adding more global pointers to components/arc/ seems sad. We already have > > enough. Instead of this, what about the following: > > > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > > * Add [set_]arc_intent_helper_bridge() setter/getter to ArcServiceManager. > > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > > ArcServiceManager; > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > ArcIntentHelperBridge's ctor, and > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. > > * In chrome/browser/, get an ArcIntentHelperBridge instance with > > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > > > ArcServiceManager is already a singleton and has Get() method. The manager > also > > has getters like icon_loader() for allowing chrome/browser/ code to use > > components/arc/'s objects. The proposal above follows the current way to some > > extent. > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > ArcIntentHelperBridge's ctor, and > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. > > I do not want this. If we'll get rid of global ptr, I prefer calling the setter > in ArcServiceLauncher::Initialize() instead. > > > ArcServiceManager is already a singleton and has Get() method. The manager > also > > has getters like icon_loader() for allowing chrome/browser/ code to use > > components/arc/'s objects. The proposal above follows the current way to some > > extent. > > We have some getters, but those are not for ArcService classes, so this looks > something new to me, too. (And that's why I recommended to oka@ san to use > global ptr.) Well, I wanted to make the code *look* slightly better (although it does not resolve anything and the member variable is still effectively like a global pointer) but if it's not for your taste, that's fine :) BTW, I have another idea to remove g_arc_intent_helper_bridge (this time, really) and confirmed that hidehiko@ is okay with it. The idea is: * Continue to define the Observer class, but probably in a dedicated file in components/arc/intent_helper/. * Add AddObserver and RemoveObserver to ArcIntentHelperBridge. * Let ArcServiceManager observe ArcIntentHelperBridge. You can call ArcIntentHelperBridge::AddObserver(arc_service_manager); in ArcServiceLauncher::Initialize() where ArcIntentHelperBridge is created and added to ArcServiceManager. * Since ArcServiceManager always outlives the ArcIntentHelperBridge object, ArcServiceManager doesn't have to call ArcIntentHelperBridge::RemoveObserver(this); (we need some code comments though.) * Let your EventRouter code observe ArcServiceManager, instead of ArcIntentHelperBridge. You can call ArcServiceManager::AddObserver() in EventRouter::ObserveEvents(). * You can also call ArcServiceManager::RemoveObserver() in EventRouter::Shutdown(). When EventRouter::Shutdown() is called, ArcIntentHelperBridge has already been gone, but ArcServiceManager is still there. * Obviously, you also have to chain the OnAppsUpdated() calls. ArcIntentHelperBridge calls its observers' OnAppsUpdated(), which is ASM's OnAppsUpdated(). ASM's OnAppsUpdated() calls its observers' OnAppsUpdated(), which is EventRouter::OnAppsUpdated(). WDYT?
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_x86-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-ge...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=TBD CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=TBD CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=TBD CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=tested using Minnie together with the next CL. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:40: #include "components/arc/intent_helper/arc_intent_helper_bridge.h" On 2016/11/17 02:29:54, Yusuke Sato wrote: > nit: Remove. You can rely on the header file in this case. > > https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes > reads "However, any includes present in the related header do not need to be > included again in the related cc (i.e., foo.cc can rely on foo.h's includes)." Done. https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.cc:507: bridge->AddObserver(this); On 2016/11/17 02:29:54, Yusuke Sato wrote: > AddObserver should almost always be paired with RemoveObserver. For other > observer interfaces, EventRouter::Shutdown() seems to call RemoveObserver in the > reverse order. Shouldn't we do that too? Done. https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... File chrome/browser/chromeos/extensions/file_manager/event_router.h (right): https://codereview.chromium.org/2487623002/diff/40001/chrome/browser/chromeos... chrome/browser/chromeos/extensions/file_manager/event_router.h:74: void OnAppsUpdated() override; On 2016/11/17 02:29:54, Yusuke Sato wrote: > // arc::ArcIntentHelperBridge::Observer oderrides: > > to be consistent with L76. Done. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid to assume the class is singleton. On 2016/11/17 04:22:37, Yusuke Sato wrote: > Adding more global pointers to components/arc/ seems sad. We already have > enough. Instead of this, what about the following: > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > * Add [set_]arc_intent_helper_bridge() setter/getter to ArcServiceManager. > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > ArcServiceManager; > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > ArcIntentHelperBridge's ctor, and > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. > * In chrome/browser/, get an ArcIntentHelperBridge instance with > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > ArcServiceManager is already a singleton and has Get() method. The manager also > has getters like icon_loader() for allowing chrome/browser/ code to use > components/arc/'s objects. The proposal above follows the current way to some > extent. Abe-san suggested this solution. @hidehiko what do you think? https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid to assume the class is singleton. On 2016/11/17 09:15:27, Yusuke Sato wrote: > On 2016/11/17 07:34:19, hidehiko wrote: > > On 2016/11/17 04:22:37, Yusuke Sato wrote: > > > Adding more global pointers to components/arc/ seems sad. We already have > > > enough. Instead of this, what about the following: > > > > > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > > > * Add [set_]arc_intent_helper_bridge() setter/getter to ArcServiceManager. > > > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > > > ArcServiceManager; > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > > ArcIntentHelperBridge's ctor, and > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. > > > * In chrome/browser/, get an ArcIntentHelperBridge instance with > > > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > > > > > ArcServiceManager is already a singleton and has Get() method. The manager > > also > > > has getters like icon_loader() for allowing chrome/browser/ code to use > > > components/arc/'s objects. The proposal above follows the current way to > some > > > extent. > > > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > ArcIntentHelperBridge's ctor, and > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. > > > > I do not want this. If we'll get rid of global ptr, I prefer calling the > setter > > in ArcServiceLauncher::Initialize() instead. > > > > > ArcServiceManager is already a singleton and has Get() method. The manager > > also > > > has getters like icon_loader() for allowing chrome/browser/ code to use > > > components/arc/'s objects. The proposal above follows the current way to > some > > > extent. > > > > We have some getters, but those are not for ArcService classes, so this looks > > something new to me, too. (And that's why I recommended to oka@ san to use > > global ptr.) > > Well, I wanted to make the code *look* slightly better (although it does not > resolve anything and the member variable is still effectively like a global > pointer) but if it's not for your taste, that's fine :) > > BTW, I have another idea to remove g_arc_intent_helper_bridge (this time, > really) and confirmed that hidehiko@ is okay with it. The idea is: > > * Continue to define the Observer class, but probably in a dedicated file in > components/arc/intent_helper/. > * Add AddObserver and RemoveObserver to ArcIntentHelperBridge. > * Let ArcServiceManager observe ArcIntentHelperBridge. You can call > ArcIntentHelperBridge::AddObserver(arc_service_manager); in > ArcServiceLauncher::Initialize() where ArcIntentHelperBridge is created and > added to ArcServiceManager. > * Since ArcServiceManager always outlives the ArcIntentHelperBridge object, > ArcServiceManager doesn't have to call > ArcIntentHelperBridge::RemoveObserver(this); (we need some code comments > though.) > * Let your EventRouter code observe ArcServiceManager, instead of > ArcIntentHelperBridge. You can call ArcServiceManager::AddObserver() in > EventRouter::ObserveEvents(). > * You can also call ArcServiceManager::RemoveObserver() in > EventRouter::Shutdown(). When EventRouter::Shutdown() is called, > ArcIntentHelperBridge has already been gone, but ArcServiceManager is still > there. > * Obviously, you also have to chain the OnAppsUpdated() calls. > ArcIntentHelperBridge calls its observers' OnAppsUpdated(), which is ASM's > OnAppsUpdated(). ASM's OnAppsUpdated() calls its observers' OnAppsUpdated(), > which is EventRouter::OnAppsUpdated(). > > WDYT? > > > > > Thank you for the suggestion. I will try the construct in the next patch. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:192: for (auto& observer : observer_list_) { On 2016/11/17 02:29:54, Yusuke Sato wrote: > nit: no {} Done. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.h (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.h:52: virtual void OnAppsUpdated() = 0; On 2016/11/17 07:34:19, hidehiko wrote: > Document please. Done. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.h:53: }; On 2016/11/17 02:29:54, Yusuke Sato wrote: > Don't we need > > protected: > virtual ~Observer() {} > > ? Done. https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.h:61: static ArcIntentHelperBridge* Get(); On 2016/11/17 07:34:19, hidehiko wrote: > It's better to note this is something workaround, and encouraged to avoid as > much as possible. > Also, could you document when this returns an instance, and when not? Done.
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=tested using Minnie together with the next CL. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid to assume the class is singleton. On 2016/11/21 07:02:15, oka wrote: > On 2016/11/17 09:15:27, Yusuke Sato wrote: > > On 2016/11/17 07:34:19, hidehiko wrote: > > > On 2016/11/17 04:22:37, Yusuke Sato wrote: > > > > Adding more global pointers to components/arc/ seems sad. We already have > > > > enough. Instead of this, what about the following: > > > > > > > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > > > > * Add [set_]arc_intent_helper_bridge() setter/getter to ArcServiceManager. > > > > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > > > > ArcServiceManager; > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > > > ArcIntentHelperBridge's ctor, and > > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its > dtor. > > > > * In chrome/browser/, get an ArcIntentHelperBridge instance with > > > > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > > > > > > > ArcServiceManager is already a singleton and has Get() method. The manager > > > also > > > > has getters like icon_loader() for allowing chrome/browser/ code to use > > > > components/arc/'s objects. The proposal above follows the current way to > > some > > > > extent. > > > > > > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > > ArcIntentHelperBridge's ctor, and > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its dtor. > > > > > > I do not want this. If we'll get rid of global ptr, I prefer calling the > > setter > > > in ArcServiceLauncher::Initialize() instead. > > > > > > > ArcServiceManager is already a singleton and has Get() method. The manager > > > also > > > > has getters like icon_loader() for allowing chrome/browser/ code to use > > > > components/arc/'s objects. The proposal above follows the current way to > > some > > > > extent. > > > > > > We have some getters, but those are not for ArcService classes, so this > looks > > > something new to me, too. (And that's why I recommended to oka@ san to use > > > global ptr.) > > > > Well, I wanted to make the code *look* slightly better (although it does not > > resolve anything and the member variable is still effectively like a global > > pointer) but if it's not for your taste, that's fine :) > > > > BTW, I have another idea to remove g_arc_intent_helper_bridge (this time, > > really) and confirmed that hidehiko@ is okay with it. The idea is: > > > > * Continue to define the Observer class, but probably in a dedicated file in > > components/arc/intent_helper/. > > * Add AddObserver and RemoveObserver to ArcIntentHelperBridge. > > * Let ArcServiceManager observe ArcIntentHelperBridge. You can call > > ArcIntentHelperBridge::AddObserver(arc_service_manager); in > > ArcServiceLauncher::Initialize() where ArcIntentHelperBridge is created and > > added to ArcServiceManager. > > * Since ArcServiceManager always outlives the ArcIntentHelperBridge object, > > ArcServiceManager doesn't have to call > > ArcIntentHelperBridge::RemoveObserver(this); (we need some code comments > > though.) > > * Let your EventRouter code observe ArcServiceManager, instead of > > ArcIntentHelperBridge. You can call ArcServiceManager::AddObserver() in > > EventRouter::ObserveEvents(). > > * You can also call ArcServiceManager::RemoveObserver() in > > EventRouter::Shutdown(). When EventRouter::Shutdown() is called, > > ArcIntentHelperBridge has already been gone, but ArcServiceManager is still > > there. > > * Obviously, you also have to chain the OnAppsUpdated() calls. > > ArcIntentHelperBridge calls its observers' OnAppsUpdated(), which is ASM's > > OnAppsUpdated(). ASM's OnAppsUpdated() calls its observers' OnAppsUpdated(), > > which is EventRouter::OnAppsUpdated(). > > > > WDYT? > > > > > > > > > > > > Thank you for the suggestion. I will try the construct in the next patch. What do you mean by "the next patch"? Next patch set in this CL, or different CL? Since this is not a small TODO but more like a structural change, I'd prefer the former unless this is urgent. https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:416: bridge->RemoveObserver(this); How did you test this? |bridge| might be NULL. https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge.h (right): https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge.h:52: // OnAppsUpdated is called when intent helper is updated. // Called when app's intent filter is updated. ?
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Update a comment.
Removed global pointer in arc_intent_helper_bridge and separeted observer class out.
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
PTAL https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid to assume the class is singleton. On 2016/11/21 17:21:05, Yusuke Sato wrote: > On 2016/11/21 07:02:15, oka wrote: > > On 2016/11/17 09:15:27, Yusuke Sato wrote: > > > On 2016/11/17 07:34:19, hidehiko wrote: > > > > On 2016/11/17 04:22:37, Yusuke Sato wrote: > > > > > Adding more global pointers to components/arc/ seems sad. We already > have > > > > > enough. Instead of this, what about the following: > > > > > > > > > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > > > > > * Add [set_]arc_intent_helper_bridge() setter/getter to > ArcServiceManager. > > > > > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > > > > > ArcServiceManager; > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > > > > ArcIntentHelperBridge's ctor, and > > > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its > > dtor. > > > > > * In chrome/browser/, get an ArcIntentHelperBridge instance with > > > > > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > > > > > > > > > ArcServiceManager is already a singleton and has Get() method. The > manager > > > > also > > > > > has getters like icon_loader() for allowing chrome/browser/ code to use > > > > > components/arc/'s objects. The proposal above follows the current way to > > > some > > > > > extent. > > > > > > > > > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > > > ArcIntentHelperBridge's ctor, and > > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its > dtor. > > > > > > > > I do not want this. If we'll get rid of global ptr, I prefer calling the > > > setter > > > > in ArcServiceLauncher::Initialize() instead. > > > > > > > > > ArcServiceManager is already a singleton and has Get() method. The > manager > > > > also > > > > > has getters like icon_loader() for allowing chrome/browser/ code to use > > > > > components/arc/'s objects. The proposal above follows the current way to > > > some > > > > > extent. > > > > > > > > We have some getters, but those are not for ArcService classes, so this > > looks > > > > something new to me, too. (And that's why I recommended to oka@ san to use > > > > global ptr.) > > > > > > Well, I wanted to make the code *look* slightly better (although it does not > > > resolve anything and the member variable is still effectively like a global > > > pointer) but if it's not for your taste, that's fine :) > > > > > > BTW, I have another idea to remove g_arc_intent_helper_bridge (this time, > > > really) and confirmed that hidehiko@ is okay with it. The idea is: > > > > > > * Continue to define the Observer class, but probably in a dedicated file in > > > components/arc/intent_helper/. > > > * Add AddObserver and RemoveObserver to ArcIntentHelperBridge. > > > * Let ArcServiceManager observe ArcIntentHelperBridge. You can call > > > ArcIntentHelperBridge::AddObserver(arc_service_manager); in > > > ArcServiceLauncher::Initialize() where ArcIntentHelperBridge is created and > > > added to ArcServiceManager. > > > * Since ArcServiceManager always outlives the ArcIntentHelperBridge object, > > > ArcServiceManager doesn't have to call > > > ArcIntentHelperBridge::RemoveObserver(this); (we need some code comments > > > though.) > > > * Let your EventRouter code observe ArcServiceManager, instead of > > > ArcIntentHelperBridge. You can call ArcServiceManager::AddObserver() in > > > EventRouter::ObserveEvents(). > > > * You can also call ArcServiceManager::RemoveObserver() in > > > EventRouter::Shutdown(). When EventRouter::Shutdown() is called, > > > ArcIntentHelperBridge has already been gone, but ArcServiceManager is still > > > there. > > > * Obviously, you also have to chain the OnAppsUpdated() calls. > > > ArcIntentHelperBridge calls its observers' OnAppsUpdated(), which is ASM's > > > OnAppsUpdated(). ASM's OnAppsUpdated() calls its observers' OnAppsUpdated(), > > > which is EventRouter::OnAppsUpdated(). > > > > > > WDYT? > > > > > > > > > > > > > > > > > > > Thank you for the suggestion. I will try the construct in the next patch. > > What do you mean by "the next patch"? Next patch set in this CL, or different > CL? Since this is not a small TODO but more like a structural change, I'd prefer > the former unless this is urgent. Updated the construct as you suggested. https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:416: bridge->RemoveObserver(this); On 2016/11/21 17:21:05, Yusuke Sato wrote: > How did you test this? |bridge| might be NULL. Test procedure is written in https://codereview.chromium.org/2513493002/ I copied it in this CL's description. I updated the construction to chain OnAppsUpdated. https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge.h (right): https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge.h:52: // OnAppsUpdated is called when intent helper is updated. On 2016/11/21 17:21:05, Yusuke Sato wrote: > // Called when app's intent filter is updated. > > ? Done.
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=TBD CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
On 2016/11/24 15:14:18, oka wrote: > PTAL > > https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... > File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): > > https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... > components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): Avoid > to assume the class is singleton. > On 2016/11/21 17:21:05, Yusuke Sato wrote: > > On 2016/11/21 07:02:15, oka wrote: > > > On 2016/11/17 09:15:27, Yusuke Sato wrote: > > > > On 2016/11/17 07:34:19, hidehiko wrote: > > > > > On 2016/11/17 04:22:37, Yusuke Sato wrote: > > > > > > Adding more global pointers to components/arc/ seems sad. We already > > have > > > > > > enough. Instead of this, what about the following: > > > > > > > > > > > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > > > > > > * Add [set_]arc_intent_helper_bridge() setter/getter to > > ArcServiceManager. > > > > > > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > > > > > > ArcServiceManager; > > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > > > > > ArcIntentHelperBridge's ctor, and > > > > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its > > > dtor. > > > > > > * In chrome/browser/, get an ArcIntentHelperBridge instance with > > > > > > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > > > > > > > > > > > ArcServiceManager is already a singleton and has Get() method. The > > manager > > > > > also > > > > > > has getters like icon_loader() for allowing chrome/browser/ code to > use > > > > > > components/arc/'s objects. The proposal above follows the current way > to > > > > some > > > > > > extent. > > > > > > > > > > > > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) in > > > > > ArcIntentHelperBridge's ctor, and > > > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its > > dtor. > > > > > > > > > > I do not want this. If we'll get rid of global ptr, I prefer calling the > > > > setter > > > > > in ArcServiceLauncher::Initialize() instead. > > > > > > > > > > > ArcServiceManager is already a singleton and has Get() method. The > > manager > > > > > also > > > > > > has getters like icon_loader() for allowing chrome/browser/ code to > use > > > > > > components/arc/'s objects. The proposal above follows the current way > to > > > > some > > > > > > extent. > > > > > > > > > > We have some getters, but those are not for ArcService classes, so this > > > looks > > > > > something new to me, too. (And that's why I recommended to oka@ san to > use > > > > > global ptr.) > > > > > > > > Well, I wanted to make the code *look* slightly better (although it does > not > > > > resolve anything and the member variable is still effectively like a > global > > > > pointer) but if it's not for your taste, that's fine :) > > > > > > > > BTW, I have another idea to remove g_arc_intent_helper_bridge (this time, > > > > really) and confirmed that hidehiko@ is okay with it. The idea is: > > > > > > > > * Continue to define the Observer class, but probably in a dedicated file > in > > > > components/arc/intent_helper/. > > > > * Add AddObserver and RemoveObserver to ArcIntentHelperBridge. > > > > * Let ArcServiceManager observe ArcIntentHelperBridge. You can call > > > > ArcIntentHelperBridge::AddObserver(arc_service_manager); in > > > > ArcServiceLauncher::Initialize() where ArcIntentHelperBridge is created > and > > > > added to ArcServiceManager. > > > > * Since ArcServiceManager always outlives the ArcIntentHelperBridge > object, > > > > ArcServiceManager doesn't have to call > > > > ArcIntentHelperBridge::RemoveObserver(this); (we need some code comments > > > > though.) > > > > * Let your EventRouter code observe ArcServiceManager, instead of > > > > ArcIntentHelperBridge. You can call ArcServiceManager::AddObserver() in > > > > EventRouter::ObserveEvents(). > > > > * You can also call ArcServiceManager::RemoveObserver() in > > > > EventRouter::Shutdown(). When EventRouter::Shutdown() is called, > > > > ArcIntentHelperBridge has already been gone, but ArcServiceManager is > still > > > > there. > > > > * Obviously, you also have to chain the OnAppsUpdated() calls. > > > > ArcIntentHelperBridge calls its observers' OnAppsUpdated(), which is ASM's > > > > OnAppsUpdated(). ASM's OnAppsUpdated() calls its observers' > OnAppsUpdated(), > > > > which is EventRouter::OnAppsUpdated(). > > > > > > > > WDYT? > > > > > > > > > > > > > > > > > > > > > > > > > > Thank you for the suggestion. I will try the construct in the next patch. > > > > What do you mean by "the next patch"? Next patch set in this CL, or different > > CL? Since this is not a small TODO but more like a structural change, I'd > prefer > > the former unless this is urgent. > > Updated the construct as you suggested. > > https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... > File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): > > https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... > chrome/browser/chromeos/extensions/file_manager/event_router.cc:416: > bridge->RemoveObserver(this); > On 2016/11/21 17:21:05, Yusuke Sato wrote: > > How did you test this? |bridge| might be NULL. > > Test procedure is written in https://codereview.chromium.org/2513493002/ > I copied it in this CL's description. > > I updated the construction to chain OnAppsUpdated. > > https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... > File components/arc/intent_helper/arc_intent_helper_bridge.h (right): > > https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... > components/arc/intent_helper/arc_intent_helper_bridge.h:52: // OnAppsUpdated is > called when intent helper is updated. > On 2016/11/21 17:21:05, Yusuke Sato wrote: > > // Called when app's intent filter is updated. > > > > ? > > Done. I will perform the following test tomorrow: Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST=TBD CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST= I will perform the following test tomorrow: Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle. 4. Uninstall Kindle. 5. Confirm "more action..." no longer appears and Open button doesn't show Kindle up anymore. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
On 2016/11/24 15:15:09, oka wrote: > On 2016/11/24 15:14:18, oka wrote: > > PTAL > > > > > https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... > > File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): > > > > > https://codereview.chromium.org/2487623002/diff/40001/components/arc/intent_h... > > components/arc/intent_helper/arc_intent_helper_bridge.cc:26: // TODO(oka): > Avoid > > to assume the class is singleton. > > On 2016/11/21 17:21:05, Yusuke Sato wrote: > > > On 2016/11/21 07:02:15, oka wrote: > > > > On 2016/11/17 09:15:27, Yusuke Sato wrote: > > > > > On 2016/11/17 07:34:19, hidehiko wrote: > > > > > > On 2016/11/17 04:22:37, Yusuke Sato wrote: > > > > > > > Adding more global pointers to components/arc/ seems sad. We already > > > have > > > > > > > enough. Instead of this, what about the following: > > > > > > > > > > > > > > * Remove g_arc_intent_helper_bridge and ArcIntentHelperBridge::Get() > > > > > > > * Add [set_]arc_intent_helper_bridge() setter/getter to > > > ArcServiceManager. > > > > > > > * Add arc_intent_helper_bridge_ raw pointer (member variable) to > > > > > > > ArcServiceManager; > > > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) > in > > > > > > > ArcIntentHelperBridge's ctor, and > > > > > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in > its > > > > dtor. > > > > > > > * In chrome/browser/, get an ArcIntentHelperBridge instance with > > > > > > > ArcServiceManager::Get()->arc_intent_helper_bridge(). > > > > > > > > > > > > > > ArcServiceManager is already a singleton and has Get() method. The > > > manager > > > > > > also > > > > > > > has getters like icon_loader() for allowing chrome/browser/ code to > > use > > > > > > > components/arc/'s objects. The proposal above follows the current > way > > to > > > > > some > > > > > > > extent. > > > > > > > > > > > > > > > > > > > * Call ArcServiceManager::Get()->set_arc_intent_helper_bridge(this) > in > > > > > > ArcIntentHelperBridge's ctor, and > > > > > > ArcServiceManager::Get()->set_arc_intent_helper_bridge(nullptr) in its > > > dtor. > > > > > > > > > > > > I do not want this. If we'll get rid of global ptr, I prefer calling > the > > > > > setter > > > > > > in ArcServiceLauncher::Initialize() instead. > > > > > > > > > > > > > ArcServiceManager is already a singleton and has Get() method. The > > > manager > > > > > > also > > > > > > > has getters like icon_loader() for allowing chrome/browser/ code to > > use > > > > > > > components/arc/'s objects. The proposal above follows the current > way > > to > > > > > some > > > > > > > extent. > > > > > > > > > > > > We have some getters, but those are not for ArcService classes, so > this > > > > looks > > > > > > something new to me, too. (And that's why I recommended to oka@ san to > > use > > > > > > global ptr.) > > > > > > > > > > Well, I wanted to make the code *look* slightly better (although it does > > not > > > > > resolve anything and the member variable is still effectively like a > > global > > > > > pointer) but if it's not for your taste, that's fine :) > > > > > > > > > > BTW, I have another idea to remove g_arc_intent_helper_bridge (this > time, > > > > > really) and confirmed that hidehiko@ is okay with it. The idea is: > > > > > > > > > > * Continue to define the Observer class, but probably in a dedicated > file > > in > > > > > components/arc/intent_helper/. > > > > > * Add AddObserver and RemoveObserver to ArcIntentHelperBridge. > > > > > * Let ArcServiceManager observe ArcIntentHelperBridge. You can call > > > > > ArcIntentHelperBridge::AddObserver(arc_service_manager); in > > > > > ArcServiceLauncher::Initialize() where ArcIntentHelperBridge is created > > and > > > > > added to ArcServiceManager. > > > > > * Since ArcServiceManager always outlives the ArcIntentHelperBridge > > object, > > > > > ArcServiceManager doesn't have to call > > > > > ArcIntentHelperBridge::RemoveObserver(this); (we need some code comments > > > > > though.) > > > > > * Let your EventRouter code observe ArcServiceManager, instead of > > > > > ArcIntentHelperBridge. You can call ArcServiceManager::AddObserver() in > > > > > EventRouter::ObserveEvents(). > > > > > * You can also call ArcServiceManager::RemoveObserver() in > > > > > EventRouter::Shutdown(). When EventRouter::Shutdown() is called, > > > > > ArcIntentHelperBridge has already been gone, but ArcServiceManager is > > still > > > > > there. > > > > > * Obviously, you also have to chain the OnAppsUpdated() calls. > > > > > ArcIntentHelperBridge calls its observers' OnAppsUpdated(), which is > ASM's > > > > > OnAppsUpdated(). ASM's OnAppsUpdated() calls its observers' > > OnAppsUpdated(), > > > > > which is EventRouter::OnAppsUpdated(). > > > > > > > > > > WDYT? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thank you for the suggestion. I will try the construct in the next patch. > > > > > > What do you mean by "the next patch"? Next patch set in this CL, or > different > > > CL? Since this is not a small TODO but more like a structural change, I'd > > prefer > > > the former unless this is urgent. > > > > Updated the construct as you suggested. > > > > > https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... > > File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): > > > > > https://codereview.chromium.org/2487623002/diff/160001/chrome/browser/chromeo... > > chrome/browser/chromeos/extensions/file_manager/event_router.cc:416: > > bridge->RemoveObserver(this); > > On 2016/11/21 17:21:05, Yusuke Sato wrote: > > > How did you test this? |bridge| might be NULL. > > > > Test procedure is written in https://codereview.chromium.org/2513493002/ > > I copied it in this CL's description. > > > > I updated the construction to chain OnAppsUpdated. > > > > > https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... > > File components/arc/intent_helper/arc_intent_helper_bridge.h (right): > > > > > https://codereview.chromium.org/2487623002/diff/160001/components/arc/intent_... > > components/arc/intent_helper/arc_intent_helper_bridge.h:52: // OnAppsUpdated > is > > called when intent helper is updated. > > On 2016/11/21 17:21:05, Yusuke Sato wrote: > > > // Called when app's intent filter is updated. > > > > > > ? > > > > Done. > > I will perform the following test tomorrow: > Manually tested using Minnie with this CL > https://codereview.chromium.org/2513493002/: > 1. Select a PDF file on Files App. > 2. Install Kindle. > 3. Confirm "more action..." appears on the context menu and Open > button's UI changes to be able to open Kindle. PTAL. I've done the test.
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Almost looks good! I only have minor comments. https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... File chrome/browser/chromeos/arc/arc_service_launcher.cc (right): https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/arc/arc_service_launcher.cc:6: #include <utility> for std::move? https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:400: EventRouter::~EventRouter() { Optional: while you're here, how about s/{}/= default;/ here, too? https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.h (right): https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.h:74: // arc::ArcIntentHelperBridge::Observer overrides. arc::ArcServiceManager::Observer https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... File components/arc/arc_service_manager.h (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... components/arc/arc_service_manager.h:13: #include "base/task_runner.h" #include "base/observer_list.h" looks missing. https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... components/arc/arc_service_manager.h:29: : public arc::ArcIntentHelperObserver { I think this line can be merged with above one. Could you run "git cl format"? https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... components/arc/arc_service_manager.h:36: virtual ~Observer() {} s/{}/= default; https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge.cc:177: for (auto& observer : observer_list_) Could you add simple unittest to make sure observer is actually called on OnIntentFiltersUpdated() invocation? https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge.h (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge.h:20: #include "components/arc/intent_helper/arc_intent_helper_observer.h" Can you use forward decl? https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_observer.h (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_observer.h:15: virtual ~ArcIntentHelperObserver() {} s/{}/= default;/
Oops, sorry, I overlooked one more stuff... https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:405: BroadcastEvent(profile_, Even if this EventRouter is for non-primary user profile, this is invoked when primary user's app-install update is observed. It may be a problem, depending on JS side implementation. IMHO, at least it is confusing. So could you avoid it by not-observing ArcServiceManager if |profile_| is non ARC support case? ArcSessionManager::IsAllowedForProfile() would help you to implement it.
https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... File chrome/browser/chromeos/arc/arc_service_launcher.cc (right): https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/arc/arc_service_launcher.cc:6: On 2016/11/25 15:38:00, hidehiko wrote: > #include <utility> for std::move? Done. https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:400: EventRouter::~EventRouter() { On 2016/11/25 15:38:00, hidehiko wrote: > Optional: while you're here, how about s/{}/= default;/ here, too? Done. https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:405: BroadcastEvent(profile_, On 2016/11/25 17:10:44, hidehiko wrote: > Even if this EventRouter is for non-primary user profile, this is invoked when > primary user's app-install update is observed. > > It may be a problem, depending on JS side implementation. IMHO, at least it is > confusing. So could you avoid it by not-observing ArcServiceManager if > |profile_| is non ARC support case? > > ArcSessionManager::IsAllowedForProfile() would help you to implement it. Done. https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.h (right): https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.h:74: // arc::ArcIntentHelperBridge::Observer overrides. On 2016/11/25 15:38:00, hidehiko wrote: > arc::ArcServiceManager::Observer Done. https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... File components/arc/arc_service_manager.h (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... components/arc/arc_service_manager.h:13: #include "base/task_runner.h" On 2016/11/25 15:38:00, hidehiko wrote: > #include "base/observer_list.h" looks missing. Done. https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... components/arc/arc_service_manager.h:29: : public arc::ArcIntentHelperObserver { On 2016/11/25 15:38:00, hidehiko wrote: > I think this line can be merged with above one. > Could you run "git cl format"? Done. https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... components/arc/arc_service_manager.h:36: virtual ~Observer() {} On 2016/11/25 15:38:00, hidehiko wrote: > s/{}/= default; Done. https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge.cc:177: for (auto& observer : observer_list_) On 2016/11/25 15:38:00, hidehiko wrote: > Could you add simple unittest to make sure observer is actually called on > OnIntentFiltersUpdated() invocation? OK. I'm working on it. https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge.h (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge.h:20: #include "components/arc/intent_helper/arc_intent_helper_observer.h" On 2016/11/25 15:38:00, hidehiko wrote: > Can you use forward decl? Newbie question: What do you mean by the forward decl? https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_observer.h (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_observer.h:15: virtual ~ArcIntentHelperObserver() {} On 2016/11/25 15:38:00, hidehiko wrote: > s/{}/= default;/ Done.
On 2016/11/28 07:15:43, oka wrote: > https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... > File chrome/browser/chromeos/arc/arc_service_launcher.cc (right): > > https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... > chrome/browser/chromeos/arc/arc_service_launcher.cc:6: > On 2016/11/25 15:38:00, hidehiko wrote: > > #include <utility> for std::move? > > Done. > > https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... > File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): > > https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... > chrome/browser/chromeos/extensions/file_manager/event_router.cc:400: > EventRouter::~EventRouter() { > On 2016/11/25 15:38:00, hidehiko wrote: > > Optional: while you're here, how about s/{}/= default;/ here, too? > > Done. > > https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... > chrome/browser/chromeos/extensions/file_manager/event_router.cc:405: > BroadcastEvent(profile_, > On 2016/11/25 17:10:44, hidehiko wrote: > > Even if this EventRouter is for non-primary user profile, this is invoked when > > primary user's app-install update is observed. > > > > It may be a problem, depending on JS side implementation. IMHO, at least it is > > confusing. So could you avoid it by not-observing ArcServiceManager if > > |profile_| is non ARC support case? > > > > ArcSessionManager::IsAllowedForProfile() would help you to implement it. > > Done. > > https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... > File chrome/browser/chromeos/extensions/file_manager/event_router.h (right): > > https://codereview.chromium.org/2487623002/diff/260001/chrome/browser/chromeo... > chrome/browser/chromeos/extensions/file_manager/event_router.h:74: // > arc::ArcIntentHelperBridge::Observer overrides. > On 2016/11/25 15:38:00, hidehiko wrote: > > arc::ArcServiceManager::Observer > > Done. > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... > File components/arc/arc_service_manager.h (right): > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... > components/arc/arc_service_manager.h:13: #include "base/task_runner.h" > On 2016/11/25 15:38:00, hidehiko wrote: > > #include "base/observer_list.h" looks missing. > > Done. > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... > components/arc/arc_service_manager.h:29: : public arc::ArcIntentHelperObserver { > On 2016/11/25 15:38:00, hidehiko wrote: > > I think this line can be merged with above one. > > Could you run "git cl format"? > > Done. > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/arc_ser... > components/arc/arc_service_manager.h:36: virtual ~Observer() {} > On 2016/11/25 15:38:00, hidehiko wrote: > > s/{}/= default; > > Done. > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... > File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... > components/arc/intent_helper/arc_intent_helper_bridge.cc:177: for (auto& > observer : observer_list_) > On 2016/11/25 15:38:00, hidehiko wrote: > > Could you add simple unittest to make sure observer is actually called on > > OnIntentFiltersUpdated() invocation? > > OK. I'm working on it. > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... > File components/arc/intent_helper/arc_intent_helper_bridge.h (right): > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... > components/arc/intent_helper/arc_intent_helper_bridge.h:20: #include > "components/arc/intent_helper/arc_intent_helper_observer.h" > On 2016/11/25 15:38:00, hidehiko wrote: > > Can you use forward decl? > > Newbie question: What do you mean by the forward decl? > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... > File components/arc/intent_helper/arc_intent_helper_observer.h (right): > > https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... > components/arc/intent_helper/arc_intent_helper_observer.h:15: virtual > ~ArcIntentHelperObserver() {} > On 2016/11/25 15:38:00, hidehiko wrote: > > s/{}/= default;/ > > Done. When I run `git cl lint`, the following message is shown. Is it something to be fixed? components/arc/intent_helper/arc_intent_helper_observer.h:8: Failed to find complete declaration of namespace arc [build/namespaces] [5]
(drive-by, will take a look in detail tomorrow.) https://codereview.chromium.org/2487623002/diff/280001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_observer.h (right): https://codereview.chromium.org/2487623002/diff/280001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_observer.h:17: };
On 2016/11/28 07:48:47, Yusuke Sato wrote: > (drive-by, will take a look in detail tomorrow.) > > https://codereview.chromium.org/2487623002/diff/280001/components/arc/intent_... > File components/arc/intent_helper/arc_intent_helper_observer.h (right): > > https://codereview.chromium.org/2487623002/diff/280001/components/arc/intent_... > components/arc/intent_helper/arc_intent_helper_observer.h:17: > }; Sorry, my bad.
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...)
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge.cc (right): https://codereview.chromium.org/2487623002/diff/260001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge.cc:177: for (auto& observer : observer_list_) On 2016/11/28 07:15:43, oka wrote: > On 2016/11/25 15:38:00, hidehiko wrote: > > Could you add simple unittest to make sure observer is actually called on > > OnIntentFiltersUpdated() invocation? > > OK. I'm working on it. Added a test which at least compile. I couldn't figure out how to test it locally. https://codereview.chromium.org/2487623002/diff/280001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_observer.h (right): https://codereview.chromium.org/2487623002/diff/280001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_observer.h:17: On 2016/11/28 07:48:47, Yusuke Sato wrote: > }; Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
PTAL.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
lgtm with nits, thanks for addressing all the comments. Defer to other owners in TOK. https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:415: if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) This line is causing the try failures. Please check. https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.h (right): https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.h:74: // arc::ArcIntentHelperBridge::Observer overrides. ArcServiceManager https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... File components/arc/arc_service_manager.cc (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... components/arc/arc_service_manager.cc:10: #include "base/observer_list.h" remove https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes "However, any includes present in the related header do not need to be included again in the related cc (i.e., foo.cc can rely on foo.h's includes)." https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... File components/arc/arc_service_manager.h (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... components/arc/arc_service_manager.h:63: // arc::ArcIntentHelperBridge::Observer overrides. // arc::ArcIntentHelperObserver overrides. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:1: // Copyright 2016 The Chromium Authors. All rights reserved. Thanks for adding the test! https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:8: #include <vector> This is already in arc_intent_helper_bridge.h. Remove? https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:10: #include "base/memory/ptr_util.h" What is this for? https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:19: class ArcIntentHelperTest : public testing::Test { Please put this in an anonymous namespace. namespace arc { namespace { class ... { }; } // namespace } // namespace arc https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:22: : icon_loader_(new ActivityIconLoader), nit: could you add ()? IIUC, Chromium folks are trying to always prefer 'new T()' style. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:23: activity_resolver_(new LocalActivityResolver) {} same https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:33: fake_arc_bridge_service_.reset(new FakeArcBridgeService); same https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:143: std::unique_ptr<FakeObserver> observer(new FakeObserver); same https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:146: instance_->OnIntentFiltersUpdated(std::move(v)); nit: I'd add EXPECT_FALSE() call between L145&146. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:149: } Can you also do observer->updated_ = false; // or observer.Reset(); instance_->RemoveObserver(observer.get()); instance_->OnIntentFiltersUpdated(std::move(v2)); EXPECT_FALSE(observer->updated_); to test RemoveObserver? https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_observer.h (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_observer.h:1: // Copyright 2016 The Chromium Authors. All rights reserved. I suggested you define the interface in a separate file because I assumed you'd reuse this in ArcServiceManager (instead of defining its own ArcServiceManager::Observer), but well, having its own ArcServiceManager::Observer seems just fine (and probably better.) Feel free to merge this back to ArcIntentHelperBridge if you want. I'm also fine with the current code though.
https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:415: if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) On 2016/11/28 19:24:53, Yusuke Sato wrote: > This line is causing the try failures. Please check. FYI, removing an unknown observer from base::ObserverList is always no-op (and I think it's okay to assume that AddObserver/RemoveObserver methods in Chromium are backed by the base class unless otherwise noted. You could explicitly mention that in arc_session_manager.h though.) So I think it's safe to just remove L415.
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST= I will perform the following test tomorrow: Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle. 4. Uninstall Kindle. 5. Confirm "more action..." no longer appears and Open button doesn't show Kindle up anymore. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST= - git cl try - ninja -j100 -C out/Release components_unittests && out/Release/components_unittests --gtest_filter="ArcIntentHelperTest.*" - Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle. 4. Uninstall Kindle. 5. Confirm "more action..." no longer appears and Open button doesn't show Kindle up anymore. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:415: if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) On 2016/11/29 01:26:40, Yusuke Sato wrote: > On 2016/11/28 19:24:53, Yusuke Sato wrote: > > This line is causing the try failures. Please check. > > FYI, removing an unknown observer from base::ObserverList is always no-op (and I > think it's okay to assume that AddObserver/RemoveObserver methods in Chromium > are backed by the base class unless otherwise noted. You could explicitly > mention that in arc_session_manager.h though.) So I think it's safe to just > remove L415. > Done. Thanks! https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.h (right): https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.h:74: // arc::ArcIntentHelperBridge::Observer overrides. On 2016/11/28 19:24:54, Yusuke Sato wrote: > ArcServiceManager Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... File components/arc/arc_service_manager.cc (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... components/arc/arc_service_manager.cc:10: #include "base/observer_list.h" On 2016/11/28 19:24:54, Yusuke Sato wrote: > remove > > https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes > "However, any includes present in the related header do not need to be included > again in the related cc (i.e., foo.cc can rely on foo.h's includes)." Done. Thanks. https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... File components/arc/arc_service_manager.h (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/arc_ser... components/arc/arc_service_manager.h:63: // arc::ArcIntentHelperBridge::Observer overrides. On 2016/11/28 19:24:54, Yusuke Sato wrote: > // arc::ArcIntentHelperObserver overrides. Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:1: // Copyright 2016 The Chromium Authors. All rights reserved. On 2016/11/28 19:24:54, Yusuke Sato wrote: > Thanks for adding the test! Acknowledged. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:8: #include <vector> On 2016/11/28 19:24:54, Yusuke Sato wrote: > This is already in arc_intent_helper_bridge.h. Remove? > Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:10: #include "base/memory/ptr_util.h" On 2016/11/28 19:24:54, Yusuke Sato wrote: > What is this for? Removed. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:19: class ArcIntentHelperTest : public testing::Test { On 2016/11/28 19:24:54, Yusuke Sato wrote: > Please put this in an anonymous namespace. > > namespace arc { > > namespace { > > class ... { > > }; > > } // namespace > > } // namespace arc Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:22: : icon_loader_(new ActivityIconLoader), On 2016/11/28 19:24:54, Yusuke Sato wrote: > nit: could you add ()? IIUC, Chromium folks are trying to always prefer 'new > T()' style. > Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:23: activity_resolver_(new LocalActivityResolver) {} On 2016/11/28 19:24:54, Yusuke Sato wrote: > same Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:33: fake_arc_bridge_service_.reset(new FakeArcBridgeService); On 2016/11/28 19:24:54, Yusuke Sato wrote: > same Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:143: std::unique_ptr<FakeObserver> observer(new FakeObserver); On 2016/11/28 19:24:54, Yusuke Sato wrote: > same Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:146: instance_->OnIntentFiltersUpdated(std::move(v)); On 2016/11/28 19:24:54, Yusuke Sato wrote: > nit: I'd add EXPECT_FALSE() call between L145&146. Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:149: } On 2016/11/28 19:24:54, Yusuke Sato wrote: > Can you also do > > observer->updated_ = false; // or observer.Reset(); > instance_->RemoveObserver(observer.get()); > instance_->OnIntentFiltersUpdated(std::move(v2)); > EXPECT_FALSE(observer->updated_); > > to test RemoveObserver? Done. https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_observer.h (right): https://codereview.chromium.org/2487623002/diff/340001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_observer.h:1: // Copyright 2016 The Chromium Authors. All rights reserved. On 2016/11/28 19:24:54, Yusuke Sato wrote: > I suggested you define the interface in a separate file because I assumed you'd > reuse this in ArcServiceManager (instead of defining its own > ArcServiceManager::Observer), but well, having its own > ArcServiceManager::Observer seems just fine (and probably better.) > > Feel free to merge this back to ArcIntentHelperBridge if you want. I'm also fine > with the current code though. OK. I'd wait for @hidehiko's input.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm from my side, too.
On 2016/11/29 11:02:30, kinaba wrote: > lgtm from my side, too. Thank you! I'll commit this tomorrow if there is no additional input.
Minor comments only. (Sorry for delay). https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc (right): https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:22: : icon_loader_(new ActivityIconLoader()), Optional: How about put these into SetUp()/TearDown() so that initialization can be done in one place? https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:26: std::unique_ptr<FakeArcBridgeService> fake_arc_bridge_service_; Could you kindly sort the order in the initialization? https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:42: }; Could you add: DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperTest); ? https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:138: struct FakeObserver : public ArcIntentHelperObserver { Could you use class, instead? https://google.github.io/styleguide/cppguide.html#Structs_vs._Classes https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:140: FakeObserver() : updated_(false) {} You can initialize the member at declaration. FakeObserver() = default; ... bool updated_ = false; https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:142: bool updated_; the field should be private. https://google.github.io/styleguide/cppguide.html#Access_Control https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:145: // Observer should be called when intent filter is updated. Nice description! https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:146: std::unique_ptr<FakeObserver> observer(new FakeObserver()); Optional: auto observer = base::MakeUnique<FakeObserver>(); so that FakeObserver name can be once. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:148: std::vector<mojom::IntentFilterPtr> v; Optional: I think you can inline the vector. EXCEPT_FALSE(observer->updated()); instance_->OnInitFiltersUpdated(std::vector<mojom::IntentFilterPtr>()); EXPECT_TRUE(observer->updated()); Ditto for below.
PTAL. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... File components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc (right): https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:22: : icon_loader_(new ActivityIconLoader()), On 2016/11/29 15:29:30, hidehiko wrote: > Optional: How about put these into SetUp()/TearDown() so that initialization can > be done in one place? Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:26: std::unique_ptr<FakeArcBridgeService> fake_arc_bridge_service_; On 2016/11/29 15:29:30, hidehiko wrote: > Could you kindly sort the order in the initialization? Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:42: }; On 2016/11/29 15:29:30, hidehiko wrote: > Could you add: > > DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperTest); > > ? Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:138: struct FakeObserver : public ArcIntentHelperObserver { On 2016/11/29 15:29:30, hidehiko wrote: > Could you use class, instead? > https://google.github.io/styleguide/cppguide.html#Structs_vs._Classes Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:140: FakeObserver() : updated_(false) {} On 2016/11/29 15:29:30, hidehiko wrote: > You can initialize the member at declaration. > > FakeObserver() = default; > ... > bool updated_ = false; Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:142: bool updated_; On 2016/11/29 15:29:30, hidehiko wrote: > the field should be private. > https://google.github.io/styleguide/cppguide.html#Access_Control Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:145: // Observer should be called when intent filter is updated. On 2016/11/29 15:29:30, hidehiko wrote: > Nice description! Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:146: std::unique_ptr<FakeObserver> observer(new FakeObserver()); On 2016/11/29 15:29:30, hidehiko wrote: > Optional: > > auto observer = base::MakeUnique<FakeObserver>(); > > so that FakeObserver name can be once. Done. https://codereview.chromium.org/2487623002/diff/360001/components/arc/intent_... components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc:148: std::vector<mojom::IntentFilterPtr> v; On 2016/11/29 15:29:30, hidehiko wrote: > Optional: > > I think you can inline the vector. > > EXCEPT_FALSE(observer->updated()); > instance_->OnInitFiltersUpdated(std::vector<mojom::IntentFilterPtr>()); > EXPECT_TRUE(observer->updated()); > > Ditto for below. Done.
LGTM! Thank you!
The CQ bit was checked by oka@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yusukes@chromium.org, kinaba@chromium.org Link to the patchset: https://codereview.chromium.org/2487623002/#ps380001 (title: "Addressed comments.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by oka@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from hidehiko@chromium.org, yusukes@chromium.org, kinaba@chromium.org Link to the patchset: https://codereview.chromium.org/2487623002/#ps420001 (title: "Removed accidentally added function while rebasing.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thank you!
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
oka@chromium.org changed reviewers: + isherman@chromium.org
+isherman@ for extensions/browser/extension_event_histogram_value.h +mtomasz@ for chrome/common/extensions/api/file_manager_private.idl
oka@chromium.org changed reviewers: + mtomasz@chromium.org
https://codereview.chromium.org/2487623002/diff/420001/extensions/browser/ext... File extensions/browser/extension_event_histogram_value.h (right): https://codereview.chromium.org/2487623002/diff/420001/extensions/browser/ext... extensions/browser/extension_event_histogram_value.h:426: FILE_MANAGER_PRIVATE_ON_APPS_UPDATED, Please update histograms.xml, as described two lines below this ;-)
https://codereview.chromium.org/2487623002/diff/420001/extensions/browser/ext... File extensions/browser/extension_event_histogram_value.h (right): https://codereview.chromium.org/2487623002/diff/420001/extensions/browser/ext... extensions/browser/extension_event_histogram_value.h:426: FILE_MANAGER_PRIVATE_ON_APPS_UPDATED, On 2016/11/30 23:08:09, Ilya Sherman wrote: > Please update histograms.xml, as described two lines below this ;-) Done.
lgtm
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by oka@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from hidehiko@chromium.org, yusukes@chromium.org, kinaba@chromium.org Link to the patchset: https://codereview.chromium.org/2487623002/#ps440001 (title: "Updated histograms.xml.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
derat@chromium.org changed reviewers: + derat@chromium.org
ilya, mind taking a look for these files? extensions/browser/extension_event_histogram_value.h tools/metrics/histograms/histograms.xml
derat@chromium.org changed reviewers: + mpearson@chromium.org
mark, do you mind reviewing this for these files? extensions/browser/extension_event_histogram_value.h tools/metrics/histograms/histograms.xml
histograms.xml lgtm
thanks! sending to the CQ again since i'm eager for this to go in. :-)
The CQ bit was checked by derat@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by oka@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:415: if (arc::ArcSessionManager::IsAllowedForProfile(profile_)) On 2016/11/29 06:56:48, oka wrote: > On 2016/11/29 01:26:40, Yusuke Sato wrote: > > On 2016/11/28 19:24:53, Yusuke Sato wrote: > > > This line is causing the try failures. Please check. > > > > FYI, removing an unknown observer from base::ObserverList is always no-op (and > I > > think it's okay to assume that AddObserver/RemoveObserver methods in Chromium > > are backed by the base class unless otherwise noted. You could explicitly > > mention that in arc_session_manager.h though.) So I think it's safe to just > > remove L415. > > > Done. Thanks! Looks like to line is actually needed to get BrowserTest.Title pass.
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
I added the line back. Let's see what try says. On Fri, Dec 2, 2016 at 11:39 AM <oka@chromium.org> wrote: > > > https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... > File chrome/browser/chromeos/extensions/file_manager/event_router.cc > (right): > > > https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... > chrome/browser/chromeos/extensions/file_manager/event_router.cc:415: if > (arc::ArcSessionManager::IsAllowedForProfile(profile_)) > On 2016/11/29 06:56:48, oka wrote: > > On 2016/11/29 01:26:40, Yusuke Sato wrote: > > > On 2016/11/28 19:24:53, Yusuke Sato wrote: > > > > This line is causing the try failures. Please check. > > > > > > FYI, removing an unknown observer from base::ObserverList is always > no-op (and > > I > > > think it's okay to assume that AddObserver/RemoveObserver methods in > Chromium > > > are backed by the base class unless otherwise noted. You could > explicitly > > > mention that in arc_session_manager.h though.) So I think it's safe > to just > > > remove L415. > > > > > Done. Thanks! > > Looks like to line is actually needed to get BrowserTest.Title pass. > > https://codereview.chromium.org/2487623002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On 2016/12/02 02:44:25, oka wrote: > I added the line back. Let's see what try says. > > On Fri, Dec 2, 2016 at 11:39 AM <mailto:oka@chromium.org> wrote: > > > > > > > > https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... > > File chrome/browser/chromeos/extensions/file_manager/event_router.cc > > (right): > > > > > > > https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... > > chrome/browser/chromeos/extensions/file_manager/event_router.cc:415: if > > (arc::ArcSessionManager::IsAllowedForProfile(profile_)) > > On 2016/11/29 06:56:48, oka wrote: > > > On 2016/11/29 01:26:40, Yusuke Sato wrote: > > > > On 2016/11/28 19:24:53, Yusuke Sato wrote: > > > > > This line is causing the try failures. Please check. > > > > > > > > FYI, removing an unknown observer from base::ObserverList is always > > no-op (and > > > I > > > > think it's okay to assume that AddObserver/RemoveObserver methods in > > Chromium > > > > are backed by the base class unless otherwise noted. You could > > explicitly > > > > mention that in arc_session_manager.h though.) So I think it's safe > > to just > > > > remove L415. > > > > > > > Done. Thanks! > > > > Looks like to line is actually needed to get BrowserTest.Title pass. > > > > https://codereview.chromium.org/2487623002/ > > > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to mailto:chromium-reviews+unsubscribe@chromium.org. I think resurrecting the line will reintroduce this failure: https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium... Do you know how to build tests locally for your goobuntu workstation (outside the simplechrome shell) and run them with --gtest_filter? You should probably do that for faster iteration.
Yeah I know. I just wanted to run try before I go lunch. Do you have any idea what the proper fix is? On Fri, Dec 2, 2016 at 11:51 AM <yusukes@chromium.org> wrote: On 2016/12/02 02:44:25, oka wrote: > I added the line back. Let's see what try says. > > On Fri, Dec 2, 2016 at 11:39 AM <mailto:oka@chromium.org> wrote: > > > > > > > > https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... > > File chrome/browser/chromeos/extensions/file_manager/event_router.cc > > (right): > > > > > > > https://codereview.chromium.org/2487623002/diff/340001/chrome/browser/chromeo... > > chrome/browser/chromeos/extensions/file_manager/event_router.cc:415: if > > (arc::ArcSessionManager::IsAllowedForProfile(profile_)) > > On 2016/11/29 06:56:48, oka wrote: > > > On 2016/11/29 01:26:40, Yusuke Sato wrote: > > > > On 2016/11/28 19:24:53, Yusuke Sato wrote: > > > > > This line is causing the try failures. Please check. > > > > > > > > FYI, removing an unknown observer from base::ObserverList is always > > no-op (and > > > I > > > > think it's okay to assume that AddObserver/RemoveObserver methods in > > Chromium > > > > are backed by the base class unless otherwise noted. You could > > explicitly > > > > mention that in arc_session_manager.h though.) So I think it's safe > > to just > > > > remove L415. > > > > > > > Done. Thanks! > > > > Looks like to line is actually needed to get BrowserTest.Title pass. > > > > https://codereview.chromium.org/2487623002/ > > > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to mailto:chromium-reviews+unsubscribe@chromium.org. I think resurrecting the line will reintroduce this failure: https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium... Do you know how to build tests locally for your goobuntu workstation (outside the simplechrome shell) and run them with --gtest_filter? You should probably do that for faster iteration. https://codereview.chromium.org/2487623002/ -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
https://codereview.chromium.org/2487623002/diff/460001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/460001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:416: arc::ArcServiceManager::Get()->RemoveObserver(this); * EventRounter::Shutdown() is called inside the destructor of |profile_|, so it should not be called here. * On the other hand, arc::ArcServiceManager::Get() has DCHECK so it cannot be called if the instance does not exist. (Even though calling RemoveObserver on live instance might be always safe) hmm. Maybe we need something like static bool arc::ArcServiceManager::IsInitialized() { return g_arc_service_manager; } ?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2487623002/diff/460001/chrome/browser/chromeo... File chrome/browser/chromeos/extensions/file_manager/event_router.cc (right): https://codereview.chromium.org/2487623002/diff/460001/chrome/browser/chromeo... chrome/browser/chromeos/extensions/file_manager/event_router.cc:416: arc::ArcServiceManager::Get()->RemoveObserver(this); On 2016/12/02 04:04:25, kinaba wrote: > * EventRounter::Shutdown() is called inside the destructor of |profile_|, so it > should not be called here. > > * On the other hand, arc::ArcServiceManager::Get() has DCHECK so it cannot be > called if the instance does not exist. (Even though calling RemoveObserver on > live instance might be always safe) > > hmm. Maybe we need something like > > static bool arc::ArcServiceManager::IsInitialized() { return > g_arc_service_manager; } ? Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by oka@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mpearson@chromium.org, mtomasz@chromium.org, hidehiko@chromium.org, yusukes@chromium.org, kinaba@chromium.org Link to the patchset: https://codereview.chromium.org/2487623002/#ps480001 (title: "Add IsInitialized to arc_service_manager.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/12/02 05:59:26, commit-bot: I haz the power wrote: > CQ is trying da patch. Follow status at > > https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... shall we wait for components/arc/ OWNER's yet another round of review?
The CQ bit was unchecked by oka@chromium.org
The CQ bit was checked by oka@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/12/02 06:00:27, kinaba wrote: > On 2016/12/02 05:59:26, commit-bot: I haz the power wrote: > > CQ is trying da patch. Follow status at > > > > > https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... > > shall we wait for components/arc/ OWNER's yet another round of review? SG. I unset commit bit. @hidehiko, could you take a look?
On 2016/12/02 06:00:27, kinaba wrote: > On 2016/12/02 05:59:26, commit-bot: I haz the power wrote: > > CQ is trying da patch. Follow status at > > > > > https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... > > shall we wait for components/arc/ OWNER's yet another round of review? SG. I unset commit bit. @hidehiko, could you take a look?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/12/02 06:04:58, oka wrote: > On 2016/12/02 06:00:27, kinaba wrote: > > On 2016/12/02 05:59:26, commit-bot: I haz the power wrote: > > > CQ is trying da patch. Follow status at > > > > > > > > > https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... > > > > shall we wait for components/arc/ OWNER's yet another round of review? > > SG. I unset commit bit. > @hidehiko, could you take a look? lgtm
On 2016/12/02 06:09:17, Yusuke Sato wrote: > On 2016/12/02 06:04:58, oka wrote: > > On 2016/12/02 06:00:27, kinaba wrote: > > > On 2016/12/02 05:59:26, commit-bot: I haz the power wrote: > > > > CQ is trying da patch. Follow status at > > > > > > > > > > > > > > https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... > > > > > > shall we wait for components/arc/ OWNER's yet another round of review? > > > > SG. I unset commit bit. > > @hidehiko, could you take a look? > > lgtm Thank you for the review! committing...
The CQ bit was checked by oka@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 480001, "attempt_start_ts": 1480659110248280, "parent_rev": "4d79e926d837cb1ea5b01905631925e6fbaee7a1", "commit_rev": "f2d5bf352d3a126d73487f24f31c638f0e9ce1aa"}
Message was sent while issue was closed.
Committed patchset #25 (id:480001)
Message was sent while issue was closed.
Description was changed from ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST= - git cl try - ninja -j100 -C out/Release components_unittests && out/Release/components_unittests --gtest_filter="ArcIntentHelperTest.*" - Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle. 4. Uninstall Kindle. 5. Confirm "more action..." no longer appears and Open button doesn't show Kindle up anymore. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Notify Files App when ARC++ app is installed/removed. This change will later allow Files App to keep apps shown by "More actions..." in sync with ARC++. BUG=620577 TEST= - git cl try - ninja -j100 -C out/Release components_unittests && out/Release/components_unittests --gtest_filter="ArcIntentHelperTest.*" - Manually tested using Minnie with this CL https://codereview.chromium.org/2513493002/: 1. Select a PDF file on Files App. 2. Install Kindle. 3. Confirm "more action..." appears on the context menu and Open button's UI changes to be able to open Kindle. 4. Uninstall Kindle. 5. Confirm "more action..." no longer appears and Open button doesn't show Kindle up anymore. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/948665d2c9c7f3238ab22e17a44df727a76f747d Cr-Commit-Position: refs/heads/master@{#435868} ==========
Message was sent while issue was closed.
Patchset 25 (id:??) landed as https://crrev.com/948665d2c9c7f3238ab22e17a44df727a76f747d Cr-Commit-Position: refs/heads/master@{#435868} |