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

Issue 2704823002: [Extensions Bindings] Add support for custom property types (Closed)

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

Description

[Extensions Bindings] Add support for custom property types There are a few custom types that are used as properties on extension bindings. These are currently limited to: - storage.StorageArea, - types.ChromeSetting, - types.private.ChromeDirectSetting, - types.ContentSetting These types are each implemented through JS custom bindings that initialize the type and implement its functionality. Each specifies a "js_module" in the property pointing to the custom bindings. Add support for these custom types in native bindings. Instead of trying to reuse the existing JS implementation, only provide a way of specifying a native custom type. This is for a few reasons: - Eventually, we want all of these to be native. - There are only four, so implementing each isn't overwhelming (as opposed to custom bindings in general, where are there hundreds). - It doesn't make sense to shave this yak if we don't need to. Add the basic infrastructure for custom types, and implement the chrome.StorageArea type. BUG=653596 Review-Url: https://codereview.chromium.org/2704823002 Cr-Commit-Position: refs/heads/master@{#452637} Committed: https://chromium.googlesource.com/chromium/src/+/d31fa8e715fc2baa87357e62a106f5fce6f2d4cc

Patch Set 1 #

Patch Set 2 : . #

Total comments: 1

Patch Set 3 : . #

Total comments: 6

Patch Set 4 : jbroman's #

Total comments: 20

Patch Set 5 : jbroman + lazyboy #

Patch Set 6 : . #

Patch Set 7 : asan fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+610 lines, -63 lines) Patch
M chrome/test/data/extensions/api_test/native_bindings/extension/background.js View 1 1 chunk +28 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/native_bindings/extension/manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding.h View 1 5 chunks +25 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding.cc View 1 2 3 4 4 chunks +101 lines, -58 lines 0 comments Download
M extensions/renderer/api_binding_unittest.cc View 1 2 3 4 chunks +54 lines, -1 line 0 comments Download
M extensions/renderer/api_bindings_system.h View 1 2 3 4 4 chunks +18 lines, -0 lines 0 comments Download
M extensions/renderer/api_bindings_system.cc View 1 2 3 4 2 chunks +21 lines, -2 lines 0 comments Download
M extensions/renderer/native_extension_bindings_system.cc View 2 chunks +5 lines, -1 line 0 comments Download
M extensions/renderer/native_extension_bindings_system_unittest.cc View 1 1 chunk +34 lines, -0 lines 0 comments Download
A extensions/renderer/storage_area.h View 1 2 3 1 chunk +65 lines, -0 lines 0 comments Download
A extensions/renderer/storage_area.cc View 1 2 3 4 5 6 1 chunk +255 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 35 (22 generated)
Devlin
Hey folks, mind taking a look? As the CL description kind of hints at, I ...
3 years, 10 months ago (2017-02-18 02:58:43 UTC) #3
jbroman
https://codereview.chromium.org/2704823002/diff/40001/extensions/renderer/api_binding_unittest.cc File extensions/renderer/api_binding_unittest.cc (right): https://codereview.chromium.org/2704823002/diff/40001/extensions/renderer/api_binding_unittest.cc#newcode587 extensions/renderer/api_binding_unittest.cc:587: EXPECT_TRUE(type_name == "AlphaRef" || type_name == "BetaRef") << type_name; ...
3 years, 10 months ago (2017-02-21 16:47:38 UTC) #4
Devlin
https://codereview.chromium.org/2704823002/diff/40001/extensions/renderer/api_binding_unittest.cc File extensions/renderer/api_binding_unittest.cc (right): https://codereview.chromium.org/2704823002/diff/40001/extensions/renderer/api_binding_unittest.cc#newcode587 extensions/renderer/api_binding_unittest.cc:587: EXPECT_TRUE(type_name == "AlphaRef" || type_name == "BetaRef") << type_name; ...
3 years, 10 months ago (2017-02-21 18:05:40 UTC) #5
jbroman
lgtm https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/storage_area.cc File extensions/renderer/storage_area.cc (right): https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/storage_area.cc#newcode173 extensions/renderer/storage_area.cc:173: v8::Local<v8::Context> context = isolate->GetCurrentContext(); nit: I think we've ...
3 years, 10 months ago (2017-02-21 20:22:07 UTC) #6
lazyboy
Some comments/questions. https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/api_binding.cc File extensions/renderer/api_binding.cc (right): https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/api_binding.cc#newcode119 extensions/renderer/api_binding.cc:119: std::string type_name; I find giving examples of ...
3 years, 10 months ago (2017-02-22 03:37:03 UTC) #7
Devlin
https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/api_binding.cc File extensions/renderer/api_binding.cc (right): https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/api_binding.cc#newcode119 extensions/renderer/api_binding.cc:119: std::string type_name; On 2017/02/22 03:37:03, lazyboy wrote: > I ...
3 years, 10 months ago (2017-02-22 20:56:45 UTC) #11
jbroman
https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/storage_area.cc File extensions/renderer/storage_area.cc (right): https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/storage_area.cc#newcode173 extensions/renderer/storage_area.cc:173: v8::Local<v8::Context> context = isolate->GetCurrentContext(); On 2017/02/22 at 20:56:45, Devlin ...
3 years, 10 months ago (2017-02-22 21:05:28 UTC) #12
lazyboy
s/"jsmodule"/"js_module" in CL description. lgtm. https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/storage_area.cc File extensions/renderer/storage_area.cc (right): https://codereview.chromium.org/2704823002/diff/60001/extensions/renderer/storage_area.cc#newcode55 extensions/renderer/storage_area.cc:55: builder.SetValue("QUOTA_BYTES", api::storage::local::QUOTA_BYTES); On 2017/02/22 ...
3 years, 10 months ago (2017-02-22 22:15:24 UTC) #13
Devlin
On 2017/02/22 22:15:24, lazyboy wrote: > s/"jsmodule"/"js_module" in CL description. Whoops, done.
3 years, 10 months ago (2017-02-22 22:18:05 UTC) #15
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/2704823002/80001
3 years, 10 months ago (2017-02-22 22:18:55 UTC) #19
Devlin
FYI, had to update the StorageArea implementation to not use base::Bind()'d methods in SetMethod. See ...
3 years, 10 months ago (2017-02-23 21:28:18 UTC) #29
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/2704823002/120001
3 years, 10 months ago (2017-02-23 21:30:32 UTC) #32
commit-bot: I haz the power
3 years, 10 months ago (2017-02-23 21:37:39 UTC) #35
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/d31fa8e715fc2baa87357e62a106...

Powered by Google App Engine
This is Rietveld 408576698