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

Issue 2853023002: [Extensions Bindings] Add native declarativeContent verification (Closed)

Created:
3 years, 7 months ago by Devlin
Modified:
3 years, 7 months ago
Reviewers:
lazyboy, jbroman
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, jam
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions Bindings] Add native declarativeContent verification The declarativeContent API exposes constructors that initialize certain types. These constructors (sometimes) take arguments that need to be validated against the schema. Add native support for this validation by allowing native hooks to modify the API binding's object template, and using this to expose the constructor methods rather than relying on the JS custom bindings. Add additional declarativeContent-related tests and unittests for hooks modifying the API binding template. BUG=653596 Review-Url: https://codereview.chromium.org/2853023002 Cr-Commit-Position: refs/heads/master@{#469182} Committed: https://chromium.googlesource.com/chromium/src/+/92d03c12fddf6214bcb74ec328a284f39eb2f452

Patch Set 1 : . #

Patch Set 2 : +test #

Total comments: 17

Patch Set 3 : jbroman's #

Total comments: 22

Patch Set 4 : jbroman's #

Total comments: 12

Patch Set 5 : lazyboy's #

Unified diffs Side-by-side diffs Delta from patch set Stats (+459 lines, -92 lines) Patch
M chrome/browser/extensions/BUILD.gn View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc View 1 2 3 4 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_content/content_action.cc View 1 2 3 4 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_content/content_condition.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
D chrome/browser/extensions/api/declarative_content/content_constants.h View 1 2 3 4 1 chunk +0 lines, -34 lines 0 comments Download
D chrome/browser/extensions/api/declarative_content/content_constants.cc View 1 2 3 4 1 chunk +0 lines, -29 lines 0 comments Download
M chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/native_bindings_apitest.cc View 1 2 3 3 chunks +8 lines, -1 line 0 comments Download
M chrome/renderer/resources/extensions/declarative_content_custom_bindings.js View 1 2 3 3 chunks +37 lines, -16 lines 0 comments Download
M chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js View 1 2 2 chunks +24 lines, -0 lines 0 comments Download
M extensions/common/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A + extensions/common/api/declarative/declarative_constants.h View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
A + extensions/common/api/declarative/declarative_constants.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_hooks.h View 1 chunk +5 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_hooks.cc View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_hooks_delegate.h View 2 chunks +7 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_hooks_test_delegate.h View 1 2 chunks +10 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_hooks_test_delegate.cc View 1 2 chunks +13 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_unittest.cc View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download
A extensions/renderer/declarative_content_hooks_delegate.h View 1 2 1 chunk +50 lines, -0 lines 0 comments Download
A extensions/renderer/declarative_content_hooks_delegate.cc View 1 2 3 4 1 chunk +246 lines, -0 lines 0 comments Download
M extensions/renderer/native_extension_bindings_system.cc View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (16 generated)
Devlin
Hey folks, mind taking a look? https://codereview.chromium.org/2853023002/diff/60001/extensions/renderer/declarative_content_hooks_delegate.cc File extensions/renderer/declarative_content_hooks_delegate.cc (right): https://codereview.chromium.org/2853023002/diff/60001/extensions/renderer/declarative_content_hooks_delegate.cc#newcode214 extensions/renderer/declarative_content_hooks_delegate.cc:214: arguments.ThrowTypeError("Invalid invocation."); Note: ...
3 years, 7 months ago (2017-05-01 19:29:45 UTC) #9
jbroman
Some initial thoughts (mostly a couple of safety questions). https://codereview.chromium.org/2853023002/diff/60001/chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js File chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js (right): https://codereview.chromium.org/2853023002/diff/60001/chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js#newcode13 chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js:13: ...
3 years, 7 months ago (2017-05-01 20:16:40 UTC) #10
Devlin
https://codereview.chromium.org/2853023002/diff/60001/chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js File chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js (right): https://codereview.chromium.org/2853023002/diff/60001/chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js#newcode13 chrome/test/data/extensions/api_test/native_bindings/declarative_content/background.js:13: var imageData = ctx.createImageData(19, 19); On 2017/05/01 20:16:40, jbroman ...
3 years, 7 months ago (2017-05-01 20:46:48 UTC) #11
jbroman
https://codereview.chromium.org/2853023002/diff/80001/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js File chrome/renderer/resources/extensions/declarative_content_custom_bindings.js (right): https://codereview.chromium.org/2853023002/diff/80001/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js#newcode39 chrome/renderer/resources/extensions/declarative_content_custom_bindings.js:39: // Fake calling the original function as a constructor. ...
3 years, 7 months ago (2017-05-02 18:36:34 UTC) #12
Devlin
https://codereview.chromium.org/2853023002/diff/80001/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js File chrome/renderer/resources/extensions/declarative_content_custom_bindings.js (right): https://codereview.chromium.org/2853023002/diff/80001/chrome/renderer/resources/extensions/declarative_content_custom_bindings.js#newcode39 chrome/renderer/resources/extensions/declarative_content_custom_bindings.js:39: // Fake calling the original function as a constructor. ...
3 years, 7 months ago (2017-05-02 20:51:44 UTC) #13
jbroman
lgtm https://codereview.chromium.org/2853023002/diff/80001/extensions/renderer/declarative_content_hooks_delegate.cc File extensions/renderer/declarative_content_hooks_delegate.cc (right): https://codereview.chromium.org/2853023002/diff/80001/extensions/renderer/declarative_content_hooks_delegate.cc#newcode194 extensions/renderer/declarative_content_hooks_delegate.cc:194: // an unmodified instance. But we don't know ...
3 years, 7 months ago (2017-05-02 23:09:08 UTC) #14
lazyboy
lgtm https://codereview.chromium.org/2853023002/diff/100001/extensions/renderer/declarative_content_hooks_delegate.cc File extensions/renderer/declarative_content_hooks_delegate.cc (right): https://codereview.chromium.org/2853023002/diff/100001/extensions/renderer/declarative_content_hooks_delegate.cc#newcode66 extensions/renderer/declarative_content_hooks_delegate.cc:66: v8::Local<v8::String> key = gin::StringToSymbol(isolate, "css"); declarative_content_constants::kCss https://codereview.chromium.org/2853023002/diff/100001/extensions/renderer/declarative_content_hooks_delegate.cc#newcode93 extensions/renderer/declarative_content_hooks_delegate.cc:93: ...
3 years, 7 months ago (2017-05-03 18:47:01 UTC) #15
Devlin
https://codereview.chromium.org/2853023002/diff/100001/extensions/renderer/declarative_content_hooks_delegate.cc File extensions/renderer/declarative_content_hooks_delegate.cc (right): https://codereview.chromium.org/2853023002/diff/100001/extensions/renderer/declarative_content_hooks_delegate.cc#newcode66 extensions/renderer/declarative_content_hooks_delegate.cc:66: v8::Local<v8::String> key = gin::StringToSymbol(isolate, "css"); On 2017/05/03 18:47:00, lazyboy ...
3 years, 7 months ago (2017-05-03 22:55:02 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2853023002/120001
3 years, 7 months ago (2017-05-03 22:55:50 UTC) #23
commit-bot: I haz the power
3 years, 7 months ago (2017-05-03 23:05:13 UTC) #26
Message was sent while issue was closed.
Committed patchset #5 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/92d03c12fddf6214bcb74ec328a2...

Powered by Google App Engine
This is Rietveld 408576698