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

Issue 1117023002: Keep event page alive when there's some Pepper plugin on it. (Closed)

Created:
5 years, 7 months ago by emaxx
Modified:
5 years, 6 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, extensions-reviews_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, chromium-apps-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Keep event page alive when there's some Pepper plugin on it. BUG=472532 Committed: https://crrev.com/e70f5e1d286a200d420a996fcc2ff7fa7a2780a2 Cr-Commit-Position: refs/heads/master@{#331945}

Patch Set 1 #

Patch Set 2 : Fix crash in tests #

Patch Set 3 : Rewrite implementation to use an IPC channel between renderer and browser. #

Patch Set 4 : Fix tests. #

Patch Set 5 : Fix tests, remove possible flakiness. #

Patch Set 6 : Re-enable proxy for tests. #

Patch Set 7 : Fix test. #

Total comments: 39

Patch Set 8 : Move onto RenderFrame. Make test faster. #

Patch Set 9 : Disable the whole test out when DISABLE_NACL. #

Patch Set 10 : Send the event through the correct RenderFrame. #

Total comments: 3

Patch Set 11 : DCHECK instead of null-pointer condition check. #

Total comments: 1

Patch Set 12 : Remove DCHECK. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -6 lines) Patch
M chrome/browser/extensions/lazy_background_page_apitest.cc View 1 2 3 4 5 6 7 8 6 chunks +52 lines, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 2 chunks +12 lines, -0 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/browser/web_contents_observer.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +9 lines, -0 lines 0 comments Download
M extensions/browser/extension_web_contents_observer.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M extensions/browser/extension_web_contents_observer.cc View 1 2 3 4 5 6 7 2 chunks +17 lines, -0 lines 0 comments Download
M ppapi/tests/extensions/extensions.gyp View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
A ppapi/tests/extensions/load_unload/background.js View 1 2 3 4 5 6 7 1 chunk +36 lines, -0 lines 0 comments Download
A + ppapi/tests/extensions/load_unload/ext_icon.png View 1 2 3 Binary file 0 comments Download
A ppapi/tests/extensions/load_unload/load_unload.cc View 1 2 3 4 5 6 7 1 chunk +25 lines, -0 lines 0 comments Download
A + ppapi/tests/extensions/load_unload/manifest.json View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download

Messages

Total messages: 30 (5 generated)
emaxx
Bartosz, please have a look at this draft implementation. Currently it violates the existing DEPS ...
5 years, 7 months ago (2015-05-04 09:36:40 UTC) #2
emaxx
Updated the implementation: two new IPC messages between the renderer and the browser are introduced, ...
5 years, 7 months ago (2015-05-07 13:30:07 UTC) #3
emaxx
kalman@chromium.org: Please review changes in extensions/ and chrome/browser/extensions/. nasko@chromium.org: Please review changes in content/. teravest@chromium.org: ...
5 years, 7 months ago (2015-05-11 13:41:26 UTC) #5
nasko
The content/ code looks good in spirit, but should be refactored to not add new ...
5 years, 7 months ago (2015-05-11 16:24:09 UTC) #6
not at google - send to devlin
https://codereview.chromium.org/1117023002/diff/110001/chrome/browser/extensions/lazy_background_page_apitest.cc File chrome/browser/extensions/lazy_background_page_apitest.cc (right): https://codereview.chromium.org/1117023002/diff/110001/chrome/browser/extensions/lazy_background_page_apitest.cc#newcode317 chrome/browser/extensions/lazy_background_page_apitest.cc:317: #if !defined(DISABLE_NACL) Is it better to ifdef out the ...
5 years, 7 months ago (2015-05-11 17:53:48 UTC) #7
bartfab (slow)
https://codereview.chromium.org/1117023002/diff/110001/chrome/browser/extensions/lazy_background_page_apitest.cc File chrome/browser/extensions/lazy_background_page_apitest.cc (right): https://codereview.chromium.org/1117023002/diff/110001/chrome/browser/extensions/lazy_background_page_apitest.cc#newcode320 chrome/browser/extensions/lazy_background_page_apitest.cc:320: ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &extdir)); Nit: #include "testing/gtest/include/gtest/gtest.h" https://codereview.chromium.org/1117023002/diff/110001/chrome/browser/extensions/lazy_background_page_apitest.cc#newcode323 chrome/browser/extensions/lazy_background_page_apitest.cc:323: ASSERT_TRUE(LoadExtension(base::FilePath(extdir))); Why ...
5 years, 7 months ago (2015-05-18 09:57:42 UTC) #8
emaxx
Updated implementation: use RenderFrame where possible, make the new test faster. https://codereview.chromium.org/1117023002/diff/110001/chrome/browser/extensions/lazy_background_page_apitest.cc File chrome/browser/extensions/lazy_background_page_apitest.cc (right): ...
5 years, 7 months ago (2015-05-18 15:06:30 UTC) #9
bartfab (slow)
lgtm https://codereview.chromium.org/1117023002/diff/110001/extensions/browser/extension_web_contents_observer.cc File extensions/browser/extension_web_contents_observer.cc (right): https://codereview.chromium.org/1117023002/diff/110001/extensions/browser/extension_web_contents_observer.cc#newcode162 extensions/browser/extension_web_contents_observer.cc:162: ProcessManager* process_manager = ProcessManager::Get(browser_context_); On 2015/05/18 15:06:30, emaxx ...
5 years, 7 months ago (2015-05-19 10:34:59 UTC) #10
nasko
https://codereview.chromium.org/1117023002/diff/110001/content/public/browser/web_contents_observer.h File content/public/browser/web_contents_observer.h (right): https://codereview.chromium.org/1117023002/diff/110001/content/public/browser/web_contents_observer.h#newcode282 content/public/browser/web_contents_observer.h:282: // attached/detached in the page DOM. On 2015/05/18 15:06:29, ...
5 years, 7 months ago (2015-05-19 14:11:45 UTC) #11
emaxx
Addressed Nasko's comments. https://codereview.chromium.org/1117023002/diff/110001/content/public/browser/web_contents_observer.h File content/public/browser/web_contents_observer.h (right): https://codereview.chromium.org/1117023002/diff/110001/content/public/browser/web_contents_observer.h#newcode282 content/public/browser/web_contents_observer.h:282: // attached/detached in the page DOM. ...
5 years, 7 months ago (2015-05-19 17:33:40 UTC) #12
nasko
https://codereview.chromium.org/1117023002/diff/170001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://codereview.chromium.org/1117023002/diff/170001/content/renderer/render_view_impl.cc#newcode1184 content/renderer/render_view_impl.cc:1184: if (render_frame) RenderFrame should never be null, so there ...
5 years, 7 months ago (2015-05-19 17:49:34 UTC) #13
emaxx
Change according to Nasko's comment. https://codereview.chromium.org/1117023002/diff/170001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://codereview.chromium.org/1117023002/diff/170001/content/renderer/render_view_impl.cc#newcode1184 content/renderer/render_view_impl.cc:1184: if (render_frame) On 2015/05/19 ...
5 years, 7 months ago (2015-05-19 18:14:59 UTC) #14
nasko
LGTM with nit. https://codereview.chromium.org/1117023002/diff/170001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://codereview.chromium.org/1117023002/diff/170001/content/renderer/render_view_impl.cc#newcode1184 content/renderer/render_view_impl.cc:1184: if (render_frame) On 2015/05/19 18:14:59, emaxx ...
5 years, 7 months ago (2015-05-19 18:51:51 UTC) #15
emaxx
Hi Raymes, please take a look at the changes under ppapi/tests/ directory. (teravest@ turned out ...
5 years, 7 months ago (2015-05-20 20:11:26 UTC) #17
raymes
On 2015/05/20 20:11:26, emaxx wrote: > Hi Raymes, please take a look at the changes ...
5 years, 7 months ago (2015-05-22 02:32:14 UTC) #18
emaxx
On 2015/05/19 18:51:51, nasko wrote: > In general, we don't add DCHECK when the line ...
5 years, 7 months ago (2015-05-26 09:23:04 UTC) #19
nasko
On 2015/05/26 09:23:04, emaxx wrote: > On 2015/05/19 18:51:51, nasko wrote: > > In general, ...
5 years, 7 months ago (2015-05-26 16:50:04 UTC) #20
not at google - send to devlin
lgtm https://codereview.chromium.org/1117023002/diff/190001/extensions/browser/extension_web_contents_observer.cc File extensions/browser/extension_web_contents_observer.cc (right): https://codereview.chromium.org/1117023002/diff/190001/extensions/browser/extension_web_contents_observer.cc#newcode162 extensions/browser/extension_web_contents_observer.cc:162: const Extension* const extension = Kinda overboard-ing the ...
5 years, 7 months ago (2015-05-26 21:18:42 UTC) #21
emaxx
On 2015/05/26 16:50:04, nasko wrote: > On 2015/05/26 09:23:04, emaxx wrote: > > On 2015/05/19 ...
5 years, 6 months ago (2015-05-29 10:23:28 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1117023002/210001
5 years, 6 months ago (2015-05-29 10:23:47 UTC) #25
commit-bot: I haz the power
Committed patchset #12 (id:210001)
5 years, 6 months ago (2015-05-29 11:26:16 UTC) #26
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/e70f5e1d286a200d420a996fcc2ff7fa7a2780a2 Cr-Commit-Position: refs/heads/master@{#331945}
5 years, 6 months ago (2015-05-29 11:26:59 UTC) #27
nasko
On 2015/05/29 10:23:28, emaxx wrote: > On 2015/05/26 16:50:04, nasko wrote: > > On 2015/05/26 ...
5 years, 6 months ago (2015-05-29 14:01:14 UTC) #28
emaxx
On 2015/05/29 14:01:14, nasko wrote: > On 2015/05/29 10:23:28, emaxx wrote: > > On 2015/05/26 ...
5 years, 6 months ago (2015-06-02 02:06:19 UTC) #29
nasko
5 years, 6 months ago (2015-06-02 23:53:28 UTC) #30
Message was sent while issue was closed.
On 2015/06/02 02:06:19, emaxx wrote:
> On 2015/05/29 14:01:14, nasko wrote:
> > On 2015/05/29 10:23:28, emaxx wrote:
> > > On 2015/05/26 16:50:04, nasko wrote:
> > > > On 2015/05/26 09:23:04, emaxx wrote:
> > > > > On 2015/05/19 18:51:51, nasko wrote:
> > > > > > In general, we don't add DCHECK when the line after is going to
crash
> > > > anyway.
> > > > > > The nullptr crash is equivalent to the DCHECK, so let's remove
those.
> > > > > 
> > > > > I agree, the crash here seems inevitable.
> > > > > But, wouldn't the DCHECK be useful here as a documentation element? If
> we
> > > > decide
> > > > > to remove the DCHECK and if in the future a crash happens here, it
won't
> > be
> > > so
> > > > > obvious to the reader of the code: it may look like we just forgot to
> add
> > > "if
> > > > > (!= NULL)" condition - like the one that's 15 lines below.
> > > > 
> > > > The documentation is part of the Pepper instance being a
> > RenderFrameObserver.
> > > If
> > > > the object is alive, it must have a valid RenderFrame pointer. 
> > > > Can you point out the specific code you have in mind (15 lines below
which
> > > one)?
> > > 
> > > I meant the "if (render_frame)" condition in PepperInstanceDeleted()
method.
> > > Anyway, as you insist on that this dcheck is pointless, I've removed it
now.
> > 
> > Well, my comment applied to both, since they are identical usage. I didn't
> flag
> > them separately, as my assumption is once an issue is pointed out, one can
> > search for all of its occurrences. Please fix it in a follow up CL, since
> you've
> > landed this one already.
> 
> Here it is explicitly stated that PepperPluginInstanceImpl and RenderViewImpl
> may outlive RenderFrameImpl:
>
https://code.google.com/p/chromium/codesearch#chromium/src/content/renderer/p...
> So when PepperInstanceDeleted() is called, there is no guarantee that
> RenderFrameImpl still exists. Am I missing something?

I wasn't aware of this ugly artifact that PepperPluginInstance lifetime is not
quite tied to RenderFrameImpl. It looks like your code is indeed right in
RVH::PepperInstanceDeleted. We need to clean up this area of the code to ensure
that Pepper is fully moved over to use RenderFrameImpl instead of
RenderViewImpl.

Powered by Google App Engine
This is Rietveld 408576698