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

Issue 164039: Add module-level permissions to extensions. (Closed)

Created:
11 years, 4 months ago by Matt Perry
Modified:
9 years, 7 months ago
Reviewers:
Aaron Boodman, rafaelw
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add module-level permissions to extensions. This first pass is fairly simple. If a permission is not specified in the manifest, the corresponding module will not be exposed to script. For example, without specifying the "tabs" permission, chrome.tabs and chrome.windows will not be available. BUG=12140 TEST=no Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=22745

Patch Set 1 #

Total comments: 18

Patch Set 2 : addressed comments #

Total comments: 6

Patch Set 3 : final nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -53 lines) Patch
M chrome/browser/extensions/extension_function_dispatcher.cc View 3 chunks +11 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_host.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extensions_service_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extensions_ui.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/common_resources.grd View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension.h View 1 3 chunks +14 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 4 chunks +50 lines, -25 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/event_bindings.cc View 1 chunk +11 lines, -1 line 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.h View 1 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.cc View 1 2 9 chunks +103 lines, -13 lines 0 comments Download
M chrome/renderer/render_thread.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/renderer/render_thread.cc View 1 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/renderer/renderer_resources.grd View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/resources/extension_process_bindings.js View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/manifest.json View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/good/Extensions/bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0/manifest.json View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/data/extensions/uitest/event_sink/manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/data/extensions/uitest/roundtrip_api_call/manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/data/extensions/uitest/simple_api_call/manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/render_view_test.cc View 1 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Matt Perry
rafaelw: extension_process_bindings.js aa: everything else
11 years, 4 months ago (2009-08-06 01:32:53 UTC) #1
rafaelw
http://codereview.chromium.org/164039/diff/1/13 File chrome/renderer/resources/extension_process_bindings.js (right): http://codereview.chromium.org/164039/diff/1/13#newcode155 Line 155: // TODO(rafaelw): Handle synchronous functions. can you remove ...
11 years, 4 months ago (2009-08-06 15:11:37 UTC) #2
Aaron Boodman
http://codereview.chromium.org/164039/diff/1/3 File chrome/browser/extensions/extension_host.cc (right): http://codereview.chromium.org/164039/diff/1/3#newcode392 Line 392: render_view_host->Send(new ViewMsg_Extension_SetPermissions( We did used to create ExtensionFunctionDispatcher ...
11 years, 4 months ago (2009-08-06 19:25:05 UTC) #3
Matt Perry
http://codereview.chromium.org/164039/diff/1/3 File chrome/browser/extensions/extension_host.cc (right): http://codereview.chromium.org/164039/diff/1/3#newcode392 Line 392: render_view_host->Send(new ViewMsg_Extension_SetPermissions( On 2009/08/06 19:25:05, Aaron Boodman wrote: ...
11 years, 4 months ago (2009-08-06 23:58:47 UTC) #4
Aaron Boodman
lgtm, with nits. neat http://codereview.chromium.org/164039/diff/1023/1025 File chrome/browser/extensions/extension_host.cc (right): http://codereview.chromium.org/164039/diff/1023/1025#newcode392 Line 392: render_view_host->Send(new ViewMsg_Extension_SetPermissions( I guess ...
11 years, 4 months ago (2009-08-07 00:31:21 UTC) #5
Matt Perry
11 years, 4 months ago (2009-08-07 00:51:45 UTC) #6
all done

http://codereview.chromium.org/164039/diff/1023/1033
File chrome/renderer/extensions/extension_process_bindings.cc (right):

http://codereview.chromium.org/164039/diff/1023/1033#newcode165
Line 165: std::string extension_id =
*v8::String::Utf8Value(args[0]->ToString());
On 2009/08/07 00:31:21, Aaron Boodman wrote:
> Why did you make this change?

Thanks for bringing this up - it requires a JS change that I accidentally undid.

ExtensionIdFromCurrentContext might not work during chromeHidden.onLoad
dispatch, which is when this is called.  This is because the page load may not
have been committed, so the URL we check might be for the previous page. So
instead I'm plumbing the extension_id through from earlier in the code where we
get it reliably.

http://codereview.chromium.org/164039/diff/1023/1033#newcode205
Line 205: if (!ExtensionProcessBindings::CurrentContextHasPermission(name)) {
On 2009/08/07 00:31:21, Aaron Boodman wrote:
> braces not needed

Done.

Powered by Google App Engine
This is Rietveld 408576698