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

Issue 147033: Refactor extension bindings to share code, avoid exposing hidden variables (Closed)

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

Description

Refactor extension bindings to share code, avoid exposing hidden variables globally, and avoid using the DOM load/unload events. - moved callback handling into event_bindings.js (ports will use it). - added chromeHidden, a V8 hidden value, to keep all internal variables that need to be accessible to native code. - changed context registration to occur always at extension load, instead of DOM load. - added an internal unload event that doesn't disable SuddenTermination. This is a rework of my earlier CL http://codereview.chromium.org/125280 which was reverted because of a perf regression. I believe the perf problem was caused by the call into javascript I did on page load to handle context registration - this CL avoids that. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=19634

Patch Set 1 #

Total comments: 13

Patch Set 2 : comments; chromeHidden assumed #

Patch Set 3 : fix crashes and failures #

Patch Set 4 : domwindow, not frame #

Patch Set 5 : rework after webkit change #

Total comments: 6

Patch Set 6 : comment fix #

Patch Set 7 : from linux #

Patch Set 8 : at head #

Unified diffs Side-by-side diffs Delta from patch set Stats (+422 lines, -349 lines) Patch
M chrome/browser/extensions/extension_message_service.cc View 1 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/renderer/extensions/bindings_utils.h View 1 2 3 4 2 chunks +69 lines, -2 lines 0 comments Download
M chrome/renderer/extensions/bindings_utils.cc View 1 2 3 4 2 chunks +106 lines, -4 lines 0 comments Download
M chrome/renderer/extensions/event_bindings.h View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/event_bindings.cc View 1 2 3 4 5 8 chunks +96 lines, -75 lines 0 comments Download
M chrome/renderer/extensions/extension_api_client_unittest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.cc View 6 chunks +16 lines, -159 lines 0 comments Download
M chrome/renderer/extensions/renderer_extension_bindings.cc View 5 chunks +8 lines, -5 lines 0 comments Download
M chrome/renderer/js_only_v8_extensions.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 5 6 3 chunks +1 line, -9 lines 0 comments Download
M chrome/renderer/renderer_resources.grd View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/resources/event_bindings.js View 1 2 3 4 5 chunks +79 lines, -19 lines 0 comments Download
M chrome/renderer/resources/extension_process_bindings.js View 1 2 3 4 5 4 chunks +4 lines, -51 lines 0 comments Download
M chrome/renderer/resources/greasemonkey_api.js View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/renderer/resources/renderer_extension_bindings.js View 1 2 2 chunks +26 lines, -11 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Matt Perry
11 years, 6 months ago (2009-06-23 18:36:23 UTC) #1
Aaron Boodman
Nice cleanup. http://codereview.chromium.org/147033/diff/1/4 File chrome/renderer/extensions/bindings_utils.h (right): http://codereview.chromium.org/147033/diff/1/4#newcode22 Line 22: class ExtensionBase : public v8::Extension { ...
11 years, 6 months ago (2009-06-23 19:40:02 UTC) #2
Matt Perry
http://codereview.chromium.org/147033/diff/1/4 File chrome/renderer/extensions/bindings_utils.h (right): http://codereview.chromium.org/147033/diff/1/4#newcode22 Line 22: class ExtensionBase : public v8::Extension { On 2009/06/23 ...
11 years, 6 months ago (2009-06-23 20:01:17 UTC) #3
Aaron Boodman
lgtm http://codereview.chromium.org/147033/diff/1/18 File chrome/renderer/resources/renderer_extension_bindings.js (right): http://codereview.chromium.org/147033/diff/1/18#newcode37 Line 37: chromeHidden.Port = {}; On 2009/06/23 20:01:17, Matt ...
11 years, 6 months ago (2009-06-23 21:34:37 UTC) #4
Matt Perry
Dmitri, can you look at v8_proxy.cpp and see if what I did there is kosher? ...
11 years, 6 months ago (2009-06-24 01:35:04 UTC) #5
Matt Perry
On 2009/06/24 01:35:04, Matt Perry wrote: > Dmitri, can you look at v8_proxy.cpp and see ...
11 years, 6 months ago (2009-06-25 02:03:06 UTC) #6
dglazkov
keep-up Fail.
11 years, 6 months ago (2009-06-25 17:30:05 UTC) #7
Matt Perry
Sorry to make you keep reviewing this, but I checked in a webkit change (http://codereview.chromium.org/147124) ...
11 years, 5 months ago (2009-06-30 00:00:11 UTC) #8
Aaron Boodman
http://codereview.chromium.org/147033/diff/2001/3003 File chrome/renderer/extensions/bindings_utils.h (right): http://codereview.chromium.org/147033/diff/2001/3003#newcode63 Line 63: // Contains information about a single Javascript context. ...
11 years, 5 months ago (2009-06-30 01:55:06 UTC) #9
Matt Perry
http://codereview.chromium.org/147033/diff/2001/3003 File chrome/renderer/extensions/bindings_utils.h (right): http://codereview.chromium.org/147033/diff/2001/3003#newcode63 Line 63: // Contains information about a single Javascript context. ...
11 years, 5 months ago (2009-06-30 17:53:17 UTC) #10
Aaron Boodman
11 years, 5 months ago (2009-06-30 18:38:40 UTC) #11
lgtm

On 2009/06/30 17:53:17, Matt Perry wrote:
> http://codereview.chromium.org/147033/diff/2001/3003#newcode63
> Line 63: // Contains information about a single Javascript context.
> On 2009/06/30 01:55:06, Aaron Boodman wrote:
> > Nit: JavaScript, or javascript if you're feeling lazy, but not Javascript.
>
> Not in chrome's codebase..

I did a search and all three forms seem about equally prevalent in the  Chrome
codebase. And in any case, the name of the language is JavaScript. It isn't the
capitalization I would have chosen, but there it is.

Powered by Google App Engine
This is Rietveld 408576698