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

Issue 10919201: Make sure that a given app/extension requests only its own resources. (Closed)

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

Description

Make sure that a given app/extension requests only its own resources. All ApiResources of a given type live in a single pool. Until now, one app could send arbitrary resource IDs in and get another app's resources if it were lucky. Now we check that an app is getting back only its own resources. Note that this CL could have been shorter if I hadn't decided to break out the owner_extension_id in ApiResource's constructor. I decided to do this anyway because the other way to get that information (asking ApiResourceEventNotifier) violated the Law of Demeter, or even if it was a technical non-violation, I didn't feel good about relying on the incidental fact that AREN knew the extension ID. Ben for OWNERS TBR=ben@chromium.org BUG=142521 TEST=added Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=156149

Patch Set 1 : #

Total comments: 5

Patch Set 2 : Changes from mihaip's review #

Patch Set 3 : Improve tests; fix merge conflicts. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+296 lines, -77 lines) Patch
M chrome/browser/extensions/api/api_resource.h View 2 chunks +15 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/api_resource.cc View 1 chunk +9 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/api_resource_event_notifier.h View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/api_resource_manager.h View 1 1 chunk +15 lines, -7 lines 0 comments Download
A chrome/browser/extensions/api/api_resource_manager_unittest.cc View 1 2 1 chunk +79 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_api.h View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_api.cc View 1 2 10 chunks +27 lines, -9 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_apitest.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_connection.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/api/serial/serial_connection.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/socket/socket.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/socket/socket.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/socket/socket_api.cc View 1 2 13 chunks +21 lines, -13 lines 0 comments Download
chrome/browser/extensions/api/socket/tcp_socket.h View 3 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/socket/tcp_socket.cc View 1 chunk +7 lines, -4 lines 0 comments Download
chrome/browser/extensions/api/socket/tcp_socket_unittest.cc View 1 2 7 chunks +23 lines, -15 lines 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/socket/udp_socket_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/usb/usb_api.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
chrome/browser/extensions/api/usb/usb_api.cc View 1 7 chunks +27 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/usb/usb_device_resource.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/usb/usb_device_resource.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_function_test_utils.h View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_function_test_utils.cc View 1 2 1 chunk +17 lines, -3 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
miket_OOO
Having update trouble on trybots. Working on that.
8 years, 3 months ago (2012-09-11 00:12:48 UTC) #1
Mihai Parparita -not on Chrome
LGTM http://codereview.chromium.org/10919201/diff/4002/chrome/browser/extensions/api/api_resource_manager.h File chrome/browser/extensions/api/api_resource_manager.h (right): http://codereview.chromium.org/10919201/diff/4002/chrome/browser/extensions/api/api_resource_manager.h#newcode13 chrome/browser/extensions/api/api_resource_manager.h:13: #include "chrome/common/extensions/extension.h" This include seems unncessary (you're just ...
8 years, 3 months ago (2012-09-11 07:18:19 UTC) #2
miket_OOO
Thanks! I did all this.
8 years, 3 months ago (2012-09-11 16:40:21 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miket@chromium.org/10919201/5002
8 years, 3 months ago (2012-09-11 19:57:30 UTC) #4
commit-bot: I haz the power
8 years, 3 months ago (2012-09-11 22:39:09 UTC) #5
Change committed as 156149

Powered by Google App Engine
This is Rietveld 408576698