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

Issue 1433343003: [Extensions] Wait until the Window object is cleared before classifying contexts

Created:
5 years, 1 month ago by Devlin
Modified:
5 years, 1 month ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Wait until the Window object is cleared before classifying contexts If the window object of a frame hasn't been cleared, then there's no way of reliably accessing the URL, and we fail to classify the context correctly. Wait until the window object clears, adding added contexts to pending contexts. BUG=340382

Patch Set 1 #

Total comments: 9

Patch Set 2 : Daniel's #

Total comments: 10

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Patch Set 5 : Latest master #

Messages

Total messages: 17 (5 generated)
Devlin
Hey Daniel - looks like https://codereview.chromium.org/1431963002/ is shot down. This is plan B. https://codereview.chromium.org/1433343003/diff/1/extensions/renderer/extension_frame_helper.cc File ...
5 years, 1 month ago (2015-11-12 01:12:03 UTC) #3
dcheng
+haraken: is there a guide about v8 handles and when/how to use Global/Local etc? https://codereview.chromium.org/1433343003/diff/1/chrome/test/data/extensions/api_test/bindings/chromei18nrepro/iframe.js ...
5 years, 1 month ago (2015-11-13 00:26:34 UTC) #5
haraken
> +haraken: is there a guide about v8 handles and when/how to use Global/Local etc? ...
5 years, 1 month ago (2015-11-13 12:19:46 UTC) #7
Devlin
https://codereview.chromium.org/1433343003/diff/1/extensions/renderer/extension_frame_helper.cc File extensions/renderer/extension_frame_helper.cc (right): https://codereview.chromium.org/1433343003/diff/1/extensions/renderer/extension_frame_helper.cc#newcode156 extensions/renderer/extension_frame_helper.cc:156: for (PendingContext* context : pending_contexts_) { On 2015/11/13 00:26:33, ...
5 years, 1 month ago (2015-11-13 19:50:05 UTC) #8
jochen (gone - plz use gerrit)
On 2015/11/13 at 12:19:46, haraken wrote: > > +haraken: is there a guide about v8 ...
5 years, 1 month ago (2015-11-16 11:56:14 UTC) #9
Devlin
Daniel's comments addressed. Daniel, is this still worth landing with the other bug filed to ...
5 years, 1 month ago (2015-11-16 22:46:46 UTC) #11
dcheng
https://codereview.chromium.org/1433343003/diff/40001/extensions/renderer/extension_frame_helper.cc File extensions/renderer/extension_frame_helper.cc (right): https://codereview.chromium.org/1433343003/diff/40001/extensions/renderer/extension_frame_helper.cc#newcode59 extensions/renderer/extension_frame_helper.cc:59: : context(context->GetIsolate(), context), I'd suggest just capturing context here ...
5 years, 1 month ago (2015-11-18 00:57:22 UTC) #12
dcheng
Also, do extensions have anything like RenderViewTest? I'm guessing not, but if you had that, ...
5 years, 1 month ago (2015-11-18 00:58:37 UTC) #13
Devlin
On 2015/11/18 00:58:37, dcheng wrote: > Also, do extensions have anything like RenderViewTest? I'm guessing ...
5 years, 1 month ago (2015-11-18 18:02:11 UTC) #14
dcheng
https://codereview.chromium.org/1433343003/diff/40001/extensions/renderer/extension_frame_helper.cc File extensions/renderer/extension_frame_helper.cc (right): https://codereview.chromium.org/1433343003/diff/40001/extensions/renderer/extension_frame_helper.cc#newcode59 extensions/renderer/extension_frame_helper.cc:59: : context(context->GetIsolate(), context), On 2015/11/18 at 18:02:11, Devlin wrote: ...
5 years, 1 month ago (2015-11-18 18:19:53 UTC) #15
Devlin
https://codereview.chromium.org/1433343003/diff/40001/extensions/renderer/extension_frame_helper.cc File extensions/renderer/extension_frame_helper.cc (right): https://codereview.chromium.org/1433343003/diff/40001/extensions/renderer/extension_frame_helper.cc#newcode155 extensions/renderer/extension_frame_helper.cc:155: for (const auto& context : pending_contexts_) { On 2015/11/18 ...
5 years, 1 month ago (2015-11-18 18:36:28 UTC) #16
dcheng
5 years, 1 month ago (2015-11-18 18:42:51 UTC) #17
Basically, my main concern about this test is that it won't actually trigger the
failure condition at some point in the future and we'll lose this coverage.
That's why I asked about something simpler like a RenderViewTest (but thinking
about it more, even that has problems, since it depends on what order the
observers run in!) So this is fine.

Hopefully we make this situation better (https://crbug.com/555773 documents the
current situation around callbacks and how we can hopefully improve the
situation, but the work isn't yet scheduled).

lgtm

https://codereview.chromium.org/1433343003/diff/60001/chrome/test/data/extens...
File chrome/test/data/extensions/api_test/bindings/chromei18nrepro/window.js
(right):

https://codereview.chromium.org/1433343003/diff/60001/chrome/test/data/extens...
chrome/test/data/extensions/api_test/bindings/chromei18nrepro/window.js:8:
(background) ? 'defined' : 'undefined';
Btw, is it typical to wrap the condition in ( ) in a ternary operator?

https://codereview.chromium.org/1433343003/diff/60001/extensions/renderer/ext...
File extensions/renderer/extension_frame_helper.cc (right):

https://codereview.chromium.org/1433343003/diff/60001/extensions/renderer/ext...
extensions/renderer/extension_frame_helper.cc:158: v8::Local<v8::Context>
context_local =
Sorry: my comment was unclear. You can just call this "context" (and the struct
member can stay named context). My only concern was a collision between the loop
variable and the name of this local. I leave it up to you what looks best.

Powered by Google App Engine
This is Rietveld 408576698