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

Issue 173034: Validation of extension api callback and event parameters in DEBUG (Closed)

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

Description

Validation of extension api callbacks and event parameters in DEBUG BUG=18711 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=24068

Patch Set 1 #

Patch Set 2 : pre cr #

Patch Set 3 : pre cr2 #

Patch Set 4 : ok. ready now. #

Total comments: 9

Patch Set 5 : cr changes #

Patch Set 6 : touch grds #

Total comments: 4

Patch Set 7 : fix tests #

Patch Set 8 : cr change #

Patch Set 9 : woop #

Patch Set 10 : sigh, another test #

Patch Set 11 : fix uitest again #

Patch Set 12 : build docs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -87 lines) Patch
M chrome/browser/extensions/extension_uitest.cc View 7 8 9 10 7 chunks +56 lines, -27 lines 0 comments Download
M chrome/common/common_resources.grd View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/api/extension_api.json View 1 2 3 4 5 6 7 8 9 9 chunks +23 lines, -19 lines 0 comments Download
M chrome/common/extensions/docs/bookmarks.html View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/docs/tabs.html View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/docs/windows.html View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/extensions/bindings_utils.h View 2 3 4 5 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/renderer/extensions/bindings_utils.cc View 1 4 chunks +15 lines, -5 lines 0 comments Download
M chrome/renderer/extensions/event_bindings.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/event_bindings.cc View 2 3 4 1 chunk +12 lines, -1 line 0 comments Download
M chrome/renderer/extensions/extension_api_client_unittest.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.cc View 2 3 4 1 chunk +9 lines, -1 line 0 comments Download
M chrome/renderer/renderer_resources.grd View 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/resources/event_bindings.js View 1 2 3 4 5 6 7 8 3 chunks +23 lines, -2 lines 0 comments Download
M chrome/renderer/resources/extension_process_bindings.js View 1 2 3 4 5 6 7 8 chunks +51 lines, -17 lines 0 comments Download
M chrome/test/data/extensions/samples/tabs/manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/data/extensions/uitest/roundtrip_api_call/test.html View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
rafaelw
Matt, please review .cc & .h changes. The goal here is just to DCHECK if ...
11 years, 4 months ago (2009-08-19 21:22:50 UTC) #1
Matt Perry
http://codereview.chromium.org/173034/diff/36/39 File chrome/renderer/extensions/bindings_utils.h (right): http://codereview.chromium.org/173034/diff/36/39#newcode110 Line 110: // the function call. If an exception is ...
11 years, 4 months ago (2009-08-19 21:42:17 UTC) #2
rafaelw
http://codereview.chromium.org/173034/diff/36/39 File chrome/renderer/extensions/bindings_utils.h (right): http://codereview.chromium.org/173034/diff/36/39#newcode110 Line 110: // the function call. If an exception is ...
11 years, 4 months ago (2009-08-19 22:55:02 UTC) #3
Matt Perry
lgtm http://codereview.chromium.org/173034/diff/36/39 File chrome/renderer/extensions/bindings_utils.h (right): http://codereview.chromium.org/173034/diff/36/39#newcode110 Line 110: // the function call. If an exception ...
11 years, 4 months ago (2009-08-19 23:00:31 UTC) #4
Aaron Boodman
lgtm http://codereview.chromium.org/173034/diff/61/70 File chrome/renderer/resources/event_bindings.js (right): http://codereview.chromium.org/173034/diff/61/70#newcode27 Line 27: chrome.Event = function(opt_eventName, argSchemas) { Maybe name ...
11 years, 4 months ago (2009-08-20 22:20:50 UTC) #5
rafaelw
11 years, 4 months ago (2009-08-22 05:59:28 UTC) #6
http://codereview.chromium.org/173034/diff/36/39
File chrome/renderer/extensions/bindings_utils.h (right):

http://codereview.chromium.org/173034/diff/36/39#newcode110
Line 110: // the function call. If an exception is thrown NULL will be returned.
On 2009/08/19 23:00:31, Matt Perry wrote:
> On 2009/08/19 22:55:02, rafaelw wrote:
> > On 2009/08/19 21:42:17, Matt Perry wrote:
> > > What do you mean be NULL? v8::Null()? Also, I don't see where we actually
> > handle
> > > any v8 exceptions. I think there might be some code you have to do to
> cleanup
> > > the JS state after one is thrown.
> > 
> > If the called function throws an exception that isn't caught the function
call
> > actually return NULL (0x000000). retval.IsEmpty() is just a wrapper around
> > checking that the intrinsic value is 0.
> 
> Ok, in that case, can you say it returns an empty Handle? NULL doesn't really
> make sense for this data type.
> 
> > I tried catching a thrown exception. The problem with that is that as a
> > developer you want the thrown exception to show up in console.error as
> "Uncaught
> > exception" you see that you caused it. Even if i catch & re-throw in c++, it
> > doesn't show up in the console. That seems to happen only if it's uncaught.
> 
> I'm surprised it manages to show up in the console that way. We should be at
the
> bottom of the stack when we call this function, so no one is below us to
handle
> exceptions and print them. Anyway, looks good.

Done.

http://codereview.chromium.org/173034/diff/61/70
File chrome/renderer/resources/event_bindings.js (right):

http://codereview.chromium.org/173034/diff/61/70#newcode27
Line 27: chrome.Event = function(opt_eventName, argSchemas) {
On 2009/08/20 22:20:50, Aaron Boodman wrote:
> Maybe name this opt_argSchemas to be consistent with the other arg?

Done.

http://codereview.chromium.org/173034/diff/61/71
File chrome/renderer/resources/extension_process_bindings.js (right):

http://codereview.chromium.org/173034/diff/61/71#newcode86
Line 86: // if they have.
On 2009/08/20 22:20:50, Aaron Boodman wrote:
> This comment seems like the right thing to do, but doesn't seem to go with the
> statement immediately following... ?

Done.

Powered by Google App Engine
This is Rietveld 408576698