|
|
Created:
6 years, 8 months ago by limasdf Modified:
6 years, 8 months ago Reviewers:
not at google - send to devlin CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Visibility:
Public. |
DescriptionThis CL does small refactoring extension_toolbar_model.cc before removing NOTIFICATION_EXTENSION_UNLOADED and NOTIFICATION_EXTENSION_LOADED.
BUG=354046
TEST=browser_tests --gtest_filter=ExtensionToolbarModelTest.*
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266349
Patch Set 1 : #
Total comments: 3
Patch Set 2 : review feedback #Messages
Total messages: 14 (0 generated)
could you take a look? before removing OTIFICATION_EXTENSION_UNLOADED_DEPRECATED, I did small refactoring.
Nice! https://codereview.chromium.org/256783003/diff/80001/chrome/browser/extension... File chrome/browser/extensions/extension_toolbar_model.cc (right): https://codereview.chromium.org/256783003/diff/80001/chrome/browser/extension... chrome/browser/extensions/extension_toolbar_model.cc:189: ExtensionService* extension_service = it looks like this whole function early-exits if there's no extension service. that shouldn't even really be happening since it's extension service that sends these notifications, but my point is, this refactoring does change the existing logic. however, this class doesn't even need an extension service, just an extension registry, apart from that "is_ready" check, and that you can get from here: https://code.google.com/p/chromium/codesearch#chromium/src/extensions/browser... so I'd make that your refactor here. - what you have - replace ES usage with ER and ready() and take it back to the start of Observe
https://codereview.chromium.org/256783003/diff/80001/chrome/browser/extension... File chrome/browser/extensions/extension_toolbar_model.cc (right): https://codereview.chromium.org/256783003/diff/80001/chrome/browser/extension... chrome/browser/extensions/extension_toolbar_model.cc:189: ExtensionService* extension_service = On 2014/04/25 16:53:34, kalman wrote: > it looks like this whole function early-exits if there's no extension service. > that shouldn't even really be happening since it's extension service that sends > these notifications, but my point is, this refactoring does change the existing > logic. > > however, this class doesn't even need an extension service, just an extension > registry, apart from that "is_ready" check, and that you can get from here: > https://code.google.com/p/chromium/codesearch#chromium/src/extensions/browser... > > so I'd make that your refactor here. > - what you have > - replace ES usage with ER and ready() and take it back to the start of Observe another option: just pull the ES back to the start, don't use ER yet, but DCHECK(ES) rather than guarding against it being null.
Thanks for the review as always! :) please take a look my feedback. And perhaps, ER = ExtensionRegistry. ES = ExtensionSystem. ?? https://codereview.chromium.org/256783003/diff/80001/chrome/browser/extension... File chrome/browser/extensions/extension_toolbar_model.cc (right): https://codereview.chromium.org/256783003/diff/80001/chrome/browser/extension... chrome/browser/extensions/extension_toolbar_model.cc:189: ExtensionService* extension_service = On 2014/04/25 16:54:34, kalman wrote: > On 2014/04/25 16:53:34, kalman wrote: > > it looks like this whole function early-exits if there's no extension service. > > that shouldn't even really be happening since it's extension service that > sends > > these notifications, but my point is, this refactoring does change the > existing > > logic. > > > > however, this class doesn't even need an extension service, just an extension > > registry, apart from that "is_ready" check, and that you can get from here: > > > https://code.google.com/p/chromium/codesearch#chromium/src/extensions/browser... > > > > so I'd make that your refactor here. > > - what you have > > - replace ES usage with ER and ready() and take it back to the start of > Observe > > another option: just pull the ES back to the start, don't use ER yet, but > DCHECK(ES) rather than guarding against it being null. I chose second method to keep exisitng code as much as I can. Done.
yes that's what I meant by those acronyms :) lgtm could you attach a BUG though.
On 2014/04/25 20:17:46, kalman wrote: > yes that's what I meant by those acronyms :) > > lgtm > > could you attach a BUG though. hehe.. Thank you. I'm happy that I can run build bot before I go to bed :) BUG is attached.
The CQ bit was checked by limasdf@gmail.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/limasdf@gmail.com/256783003/110001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
The CQ bit was checked by limasdf@gmail.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/limasdf@gmail.com/256783003/110001
Message was sent while issue was closed.
Change committed as 266349
Message was sent while issue was closed.
@Kalman, I have one dumb question. ExtensionSystem and ExtensionRegistry they both has similar function which is checking extension is loaded. (is_ready() and ready()). how about removing one of them? |