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

Issue 10777003: Refactor APIResourceController to ProfileKeyedService. (Closed)

Created:
8 years, 5 months ago by miket_OOO
Modified:
8 years, 5 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org
Visibility:
Public.

Description

Refactored away the abomination of poor object-oriented design that was APIResourceController. - Removed APIResourceController from ExtensionService. - Conformed "API" capitalization to match style guide. - Introduced ApiResourceManager as the successor to APIResourceController. Each instance knows about exactly one ApiResource type, which allows us to avoid the horrible circular dependencies and static_casts<> of APIResourceController. - Made each ApiResourceManager a ProfileKeyedService so that it's clearer that they're bound to a single Profile. I didn't see any benefit to moving the resource destructors to PKS's Shutdown method, so I didn't do that. RECOMMENDED METHOD OF CONSUMPTION OF THIS CHANGELIST FOR MAXIMUM ENJOYMENT: 1. Understand what APIResourceController was trying to do. 2. See that APIResourceController is now gone. 3. Review the new ApiResourceManager template. 4. Confirm that all usage of APIRC is replaced with ApiRM<> usage. 5. Scan the remainder for API -> Api changes. BUG=112902 TEST=updated Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=147589

Patch Set 1 : #

Total comments: 10

Patch Set 2 : win_rel complaint fixed. #

Total comments: 4

Patch Set 3 : Merge/antony/fix build. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+444 lines, -508 lines) Patch
M chrome/browser/extensions/api/api_function.h View 1 2 4 chunks +11 lines, -16 lines 0 comments Download
M chrome/browser/extensions/api/api_function.cc View 3 chunks +19 lines, -24 lines 0 comments Download
M chrome/browser/extensions/api/api_resource.h View 1 chunk +10 lines, -19 lines 0 comments Download
M chrome/browser/extensions/api/api_resource.cc View 1 chunk +4 lines, -9 lines 0 comments Download
D chrome/browser/extensions/api/api_resource_controller.h View 1 chunk +0 lines, -77 lines 0 comments Download
D chrome/browser/extensions/api/api_resource_controller.cc View 1 chunk +0 lines, -142 lines 0 comments Download
M chrome/browser/extensions/api/api_resource_event_notifier.h View 4 chunks +14 lines, -23 lines 0 comments Download
M chrome/browser/extensions/api/api_resource_event_notifier.cc View 9 chunks +19 lines, -19 lines 0 comments Download
A chrome/browser/extensions/api/api_resource_manager.h View 1 2 1 chunk +82 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_api.h View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_api.h View 16 chunks +33 lines, -19 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_api.cc View 10 chunks +27 lines, -17 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_apitest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_connection.h View 1 chunk +7 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_connection.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.h View 1 2 18 chunks +36 lines, -30 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.cc View 1 2 13 chunks +23 lines, -16 lines 0 comments Download
M chrome/browser/extensions/api/socket/tcp_socket.h View 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/socket/tcp_socket.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/socket/tcp_socket_unittest.cc View 8 chunks +9 lines, -9 lines 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/usb/usb_api.h View 6 chunks +22 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/usb/usb_api.cc View 1 2 8 chunks +20 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/usb/usb_device_resource.h View 2 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/usb/usb_device_resource.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_service.h View 1 2 3 chunks +0 lines, -6 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 chunks +0 lines, -17 lines 0 comments Download
M chrome/browser/extensions/extension_system.h View 1 2 5 chunks +27 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_system.cc View 1 2 3 chunks +22 lines, -3 lines 0 comments Download
M chrome/browser/extensions/test_extension_system.h View 1 chunk +7 lines, -4 lines 0 comments Download
M chrome/browser/extensions/test_extension_system.cc View 2 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/browser/usb/usb_device.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
miket_OOO
Have fun.
8 years, 5 months ago (2012-07-13 22:59:33 UTC) #1
asargent_no_longer_on_chrome
LGTM w/ a bunch of nits and questions http://codereview.chromium.org/10777003/diff/17001/chrome/browser/extensions/api/api_function.h File chrome/browser/extensions/api/api_function.h (right): http://codereview.chromium.org/10777003/diff/17001/chrome/browser/extensions/api/api_function.h#newcode23 chrome/browser/extensions/api/api_function.h:23: // ...
8 years, 5 months ago (2012-07-16 18:08:25 UTC) #2
miket_OOO
Thanks. Responses inline. If the tree ever goes green again I'll try to get this ...
8 years, 5 months ago (2012-07-16 19:46:02 UTC) #3
miket_OOO
http://codereview.chromium.org/10777003/diff/5038/chrome/browser/extensions/api/api_resource_manager.h File chrome/browser/extensions/api/api_resource_manager.h (right): http://codereview.chromium.org/10777003/diff/5038/chrome/browser/extensions/api/api_resource_manager.h#newcode86 chrome/browser/extensions/api/api_resource_manager.h:86: std::map<int, linked_ptr<T> >* api_resource_map_; > Do we just leak ...
8 years, 5 months ago (2012-07-16 20:21:28 UTC) #4
miket_OOO
http://codereview.chromium.org/10777003/diff/5038/chrome/browser/extensions/api/api_resource_manager.h File chrome/browser/extensions/api/api_resource_manager.h (right): http://codereview.chromium.org/10777003/diff/5038/chrome/browser/extensions/api/api_resource_manager.h#newcode86 chrome/browser/extensions/api/api_resource_manager.h:86: std::map<int, linked_ptr<T> >* api_resource_map_; On 2012/07/16 18:08:25, Antony Sargent ...
8 years, 5 months ago (2012-07-19 18:49:07 UTC) #5
asargent_no_longer_on_chrome
http://codereview.chromium.org/10777003/diff/5038/chrome/browser/extensions/api/api_resource_manager.h File chrome/browser/extensions/api/api_resource_manager.h (right): http://codereview.chromium.org/10777003/diff/5038/chrome/browser/extensions/api/api_resource_manager.h#newcode86 chrome/browser/extensions/api/api_resource_manager.h:86: std::map<int, linked_ptr<T> >* api_resource_map_; On 2012/07/19 18:49:07, miket wrote: ...
8 years, 5 months ago (2012-07-19 20:52:21 UTC) #6
miket_OOO
> Oops, I just hadn't noticed the DeleteSoon call in the destructor. My apologies > ...
8 years, 5 months ago (2012-07-19 20:55:38 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miket@chromium.org/10777003/36003
8 years, 5 months ago (2012-07-20 00:09:47 UTC) #8
commit-bot: I haz the power
8 years, 5 months ago (2012-07-20 01:22:08 UTC) #9
Change committed as 147589

Powered by Google App Engine
This is Rietveld 408576698