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

Issue 10392008: Move declarative API into events API (Closed)

Created:
8 years, 7 months ago by battre
Modified:
8 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org, Aaron Boodman, mihaip-chromium-reviews_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Move declarative API into events API The motivation of this CL is to bring the declarative API and the rest of the events mechanism closer together in the API documentation. To achive this, we move the content of declarative.json and everything related to events from extension.json into the events.json API definition. The new "events" namespace is automatically provided to all extensions. BUG=126497, 112155 TEST=no Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=137388

Patch Set 1 #

Total comments: 29

Patch Set 2 : Fixed new event_unittest.cc #

Patch Set 3 : Addressed comments #

Total comments: 7

Patch Set 4 : Don't provide scheme to each event individually and create util module #

Total comments: 5

Patch Set 5 : Extend apiDefinitions.GetExtensionAPIDefinition to return individual apis #

Total comments: 10

Patch Set 6 : Merged with ToT #

Patch Set 7 : Merged with ToT #

Patch Set 8 : Addressed comments #

Patch Set 9 : Addressed comments #

Patch Set 10 : Rietveld is broken, another attempt to upload #

Patch Set 11 : Fix windows build configuration #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1590 lines, -2116 lines) Patch
M chrome/browser/extensions/api/declarative/declarative_api.h View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/declarative/declarative_api.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -1 line 0 comments Download
M chrome/common/extensions/api/_permission_features.json View 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/common/extensions/api/api.gyp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
D chrome/common/extensions/api/declarative.json View 1 chunk +0 lines, -236 lines 0 comments Download
M chrome/common/extensions/api/declarative_web_request.json View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
A + chrome/common/extensions/api/events.json View 2 chunks +108 lines, -97 lines 0 comments Download
M chrome/common/extensions/api/extension.json View 1 2 3 4 5 2 chunks +1 line, -13 lines 0 comments Download
M chrome/common/extensions/api/extension_api.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/docs/api_index.html View 1 chunk +1 line, -1 line 0 comments Download
D chrome/common/extensions/docs/declarative.html View 1 chunk +0 lines, -1314 lines 0 comments Download
M chrome/common/extensions/docs/declarativeWebRequest.html View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/common/extensions/docs/events.html View 4 chunks +1160 lines, -4 lines 0 comments Download
M chrome/common/extensions/docs/extension.html View 1 2 3 4 5 4 chunks +2 lines, -135 lines 0 comments Download
M chrome/common/extensions/docs/js/api_page_generator.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/docs/samples.html View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/docs/samples.json View 1 2 3 4 5 2 chunks +7 lines, -3 lines 0 comments Download
D chrome/common/extensions/docs/static/declarative.html View 1 chunk +0 lines, -140 lines 0 comments Download
M chrome/common/extensions/docs/static/declarativeWebRequest.html View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/docs/static/events.html View 1 chunk +122 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_permission_set.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions_api_resources.grd View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/extensions/api_definitions_natives.h View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/renderer/extensions/api_definitions_natives.cc View 1 2 3 4 5 6 7 2 chunks +28 lines, -1 line 0 comments Download
M chrome/renderer/extensions/event_unittest.cc View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_dispatcher.cc View 1 2 3 4 5 2 chunks +1 line, -2 lines 0 comments Download
M chrome/renderer/renderer_resources.grd View 1 2 3 4 5 2 chunks +1 line, -1 line 0 comments Download
D chrome/renderer/resources/extensions/declarative_custom_bindings.js View 1 chunk +0 lines, -76 lines 0 comments Download
M chrome/renderer/resources/extensions/declarative_webrequest_custom_bindings.js View 1 2 3 4 5 6 7 1 chunk +4 lines, -6 lines 0 comments Download
M chrome/renderer/resources/extensions/event.js View 1 2 3 4 5 6 7 5 chunks +82 lines, -30 lines 0 comments Download
M chrome/renderer/resources/extensions/schema_generated_bindings.js View 1 2 3 4 5 6 7 3 chunks +5 lines, -8 lines 0 comments Download
A chrome/renderer/resources/extensions/utils.js View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
M chrome/renderer/resources/extensions/web_request_custom_bindings.js View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/declarative/api/manifest.json View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/extensions/api_test/webrequest/manifest.json View 1 chunk +1 line, -1 line 0 comments Download
M tools/json_schema_compiler/cc_generator.py View 1 2 3 4 5 1 chunk +0 lines, -6 lines 0 comments Download
M tools/json_schema_compiler/h_generator.py View 1 2 3 4 5 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
battre
Hi. Could you please review this? Ben: for the context see http://crbug.com/126497 Thanks, Dominic https://chromiumcodereview.appspot.com/10392008/diff/1/chrome/browser/extensions/api/declarative/declarative_api.h ...
8 years, 7 months ago (2012-05-09 16:28:07 UTC) #1
battre
You can find the generated documentation here: http://www/~battre/no_crawl/docs2/events.html On 2012/05/09 16:28:07, battre wrote: > Hi. ...
8 years, 7 months ago (2012-05-09 17:54:19 UTC) #2
Aaron Boodman
This is really excellent. Thank you for taking the time to figure out how this ...
8 years, 7 months ago (2012-05-09 19:29:45 UTC) #3
not at google - send to devlin
Looks good. How does this fit into the question you asked over email about putting ...
8 years, 7 months ago (2012-05-10 09:01:24 UTC) #4
battre
Addressed comments
8 years, 7 months ago (2012-05-10 16:38:00 UTC) #5
battre
I have addressed your comments. I haven't figured out, yet, how to address the issue ...
8 years, 7 months ago (2012-05-10 16:40:28 UTC) #6
Aaron Boodman
http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js File chrome/renderer/resources/extensions/event.js (right): http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js#newcode65 chrome/renderer/resources/extensions/event.js:65: opt_eventName, opt_argSchemas, opt_eventOptions, opt_eventsSchema) { The need for the ...
8 years, 7 months ago (2012-05-10 17:14:49 UTC) #7
battre
Don't provide scheme to each event individually and create util module
8 years, 7 months ago (2012-05-10 18:05:02 UTC) #8
battre
http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js File chrome/renderer/resources/extensions/event.js (right): http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js#newcode65 chrome/renderer/resources/extensions/event.js:65: opt_eventName, opt_argSchemas, opt_eventOptions, opt_eventsSchema) { On 2012/05/10 17:14:49, Aaron ...
8 years, 7 months ago (2012-05-10 18:05:22 UTC) #9
Aaron Boodman
http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js File chrome/renderer/resources/extensions/event.js (right): http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js#newcode65 chrome/renderer/resources/extensions/event.js:65: opt_eventName, opt_argSchemas, opt_eventOptions, opt_eventsSchema) { On 2012/05/10 18:05:22, battre ...
8 years, 7 months ago (2012-05-10 18:27:50 UTC) #10
battre
On 2012/05/10 18:27:50, Aaron Boodman wrote: > http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js > File chrome/renderer/resources/extensions/event.js (right): > > http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/extensions/event.js#newcode65 ...
8 years, 7 months ago (2012-05-10 19:16:50 UTC) #11
battre
Extend apiDefinitions.GetExtensionAPIDefinition to return individual apis
8 years, 7 months ago (2012-05-11 13:07:21 UTC) #12
battre
I have extend apiDefinitions.GetExtensionAPIDefinition to return individual apis. I think we are done with the ...
8 years, 7 months ago (2012-05-11 13:08:46 UTC) #13
Aaron Boodman
lgtm http://codereview.chromium.org/10392008/diff/6040/chrome/renderer/extensions/api_definitions_natives.cc File chrome/renderer/extensions/api_definitions_natives.cc (right): http://codereview.chromium.org/10392008/diff/6040/chrome/renderer/extensions/api_definitions_natives.cc#newcode33 chrome/renderer/extensions/api_definitions_natives.cc:33: } else { You can eliminate the else ...
8 years, 7 months ago (2012-05-11 19:16:55 UTC) #14
not at google - send to devlin
lgtm, I think my comments in event.js are worth looking at though. http://codereview.chromium.org/10392008/diff/10002/chrome/renderer/resources/extensions/event.js File chrome/renderer/resources/extensions/event.js ...
8 years, 7 months ago (2012-05-14 07:29:38 UTC) #15
not at google - send to devlin
http://codereview.chromium.org/10392008/diff/10002/chrome/renderer/resources/extensions/event.js File chrome/renderer/resources/extensions/event.js (right): http://codereview.chromium.org/10392008/diff/10002/chrome/renderer/resources/extensions/event.js#newcode14 chrome/renderer/resources/extensions/event.js:14: var addRulesParams = undefined; On 2012/05/14 07:29:38, kalman wrote: ...
8 years, 7 months ago (2012-05-14 07:30:34 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/battre@chromium.org/10392008/3008
8 years, 7 months ago (2012-05-15 16:47:24 UTC) #17
commit-bot: I haz the power
Presubmit check for 10392008-3008 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 7 months ago (2012-05-15 16:47:57 UTC) #18
battre
8 years, 7 months ago (2012-05-15 16:50:09 UTC) #19
https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/ext...
File chrome/renderer/extensions/api_definitions_natives.cc (right):

https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/ext...
chrome/renderer/extensions/api_definitions_natives.cc:33: } else {
On 2012/05/11 19:16:56, Aaron Boodman wrote:
> You can eliminate the else block because of the early return.

Done.

https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/res...
File chrome/renderer/resources/extensions/event.js (right):

https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/res...
chrome/renderer/resources/extensions/event.js:18: var removeRulesParams;
On 2012/05/14 07:29:38, kalman wrote:
> I find this a bit funny to look at out of context. This is specifically for
the
> rule-based events right? Could you store these in a single object like
> "ruleFunctionSchemas" or something with keys "addRules", "getRules", and
> "removeRules"?
> 
> I find the comment on this quite hard to parse actually, maybe something like
> 
> // Schemas for the rule-style functions on the events API that
> // only need to be generated occasionally, so populate them lazily.

Done.

https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/res...
chrome/renderer/resources/extensions/event.js:24: // Schema definition of Events
object.
On 2012/05/14 07:29:38, kalman wrote:
> Schemes -> Schemas?

Done.

https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/res...
chrome/renderer/resources/extensions/event.js:115:
storeFunctionSchemes(GetExtensionAPIDefinition("events")[0]);
On 2012/05/14 07:29:38, kalman wrote:
> You really only need to load these right before calling sendRequest right? 
You
> could move all of this logic into the storeFunctionSchemes method; call it
like
> "ensureRuleSchemasLoaded" which early-exists if the ruleFunctionSchemas object
> hasn't been populated yet. Then call it right before calling sendRequest each
> time.

Done.

https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/res...
File chrome/renderer/resources/extensions/schema_generated_bindings.js (right):

https://chromiumcodereview.appspot.com/10392008/diff/6040/chrome/renderer/res...
chrome/renderer/resources/extensions/schema_generated_bindings.js:12: var events
= require('event_bindings');
On 2012/05/14 07:29:38, kalman wrote:
> Why this change? Doesn't look like it's being used?

Done.

Powered by Google App Engine
This is Rietveld 408576698