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

Issue 1148223004: Plugin Placeholders: Factor out common BindWebFrame method into base class. (Closed)

Created:
5 years, 6 months ago by tommycli
Modified:
5 years, 6 months ago
Reviewers:
Bernhard Bauer
CC:
chromium-reviews, jochen (gone - plz use gerrit)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Plugin Placeholders: Factor out common BindWebFrame method into base class. This also makes PluginPlaceholder be instantiable on its own. It no longer has any pure virtual methods. This patch is necessary to enable https://codereview.chromium.org/1158063002/ without needing to create a TestPluginPlaceholder subclass (because PluginPlaceholder has a pure virtual BindWebFrame method). This is a portion of https://codereview.chromium.org/1126073003/, which got reverted. It's possible this one will cause crashes and need to be reverted, but at least then we'll narrow down the cause very well. BUG=NONE

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -37 lines) Patch
M components/plugins/renderer/loadable_plugin_placeholder.h View 1 chunk +0 lines, -3 lines 0 comments Download
M components/plugins/renderer/loadable_plugin_placeholder.cc View 2 chunks +0 lines, -14 lines 0 comments Download
M components/plugins/renderer/mobile_youtube_plugin.h View 1 chunk +0 lines, -3 lines 0 comments Download
M components/plugins/renderer/mobile_youtube_plugin.cc View 2 chunks +0 lines, -14 lines 0 comments Download
M components/plugins/renderer/plugin_placeholder.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/plugins/renderer/plugin_placeholder.cc View 2 chunks +14 lines, -0 lines 0 comments Download
M components/plugins/renderer/webview_plugin.cc View 4 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
tommycli
bauerb: PTAL. This is a smaller portion of that patch that caused mystery crashes on ...
5 years, 6 months ago (2015-05-28 21:10:37 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1148223004/1
5 years, 6 months ago (2015-05-28 21:15:52 UTC) #4
tommycli
5 years, 6 months ago (2015-05-28 21:20:04 UTC) #5
tommycli
bauerb, jochen: One more thing that may disturb you. BindWebFrame is called twice because it's ...
5 years, 6 months ago (2015-05-28 21:24:55 UTC) #6
chrishtr
On 2015/05/28 at 21:24:55, tommycli wrote: > bauerb, jochen: One more thing that may disturb ...
5 years, 6 months ago (2015-05-28 21:27:50 UTC) #7
tommycli
On 2015/05/28 21:27:50, chrishtr wrote: > On 2015/05/28 at 21:24:55, tommycli wrote: > > bauerb, ...
5 years, 6 months ago (2015-05-28 21:34:26 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 6 months ago (2015-05-28 22:21:04 UTC) #10
Bernhard Bauer
5 years, 6 months ago (2015-05-29 10:24:56 UTC) #11
On 2015/05/28 21:24:55, tommycli wrote:
> bauerb, jochen: One more thing that may disturb you.
> 
> BindWebFrame is called twice because it's called recursively and reentrantly.
> 
> Here's the stacktrace for the second call:
> #0 0x7fc9d51fd52e base::debug::StackTrace::StackTrace()
> #1 0x7fc9e3726583 plugins::PluginPlaceholder::BindWebFrame()
> #2 0x7fc9e372686c plugins::PluginPlaceholder::BindWebFrame()
> #3 0x7fc9e372864e WebViewPlugin::didClearWindowObject()
> #4 0x7fc9e372869c WebViewPlugin::didClearWindowObject()
> #5 0x7fc9d6701359
> blink::FrameLoaderClientImpl::dispatchDidClearWindowObjectInMainWorld()
> #6 0x7fc9c93893c8
blink::FrameLoader::dispatchDidClearWindowObjectInMainWorld()
> #7 0x7fc9c851d346 blink::ScriptController::windowProxy()
> #8 0x7fc9c91dae9f blink::LocalFrame::windowProxy()
> #9 0x7fc9c855f76a blink::toV8Context()
> #10 0x7fc9d67b20fa blink::WebLocalFrameImpl::mainWorldScriptContext()
> #11 0x7fc9e37265c1 plugins::PluginPlaceholder::BindWebFrame()
> #12 0x7fc9e372686c plugins::PluginPlaceholder::BindWebFrame()
> #13 0x7fc9e372864e WebViewPlugin::didClearWindowObject()
> #14 0x7fc9e372869c WebViewPlugin::didClearWindowObject()
> #15 0x7fc9d6701359
> blink::FrameLoaderClientImpl::dispatchDidClearWindowObjectInMainWorld()
> #16 0x7fc9c93840a9
blink::FrameLoader::dispatchDidClearDocumentOfWindowObject()
> #17 0x7fc9c9383eb6 blink::FrameLoader::receivedFirstData()
> #18 0x7fc9c936bf1a blink::DocumentLoader::ensureWriter()
> #19 0x7fc9c936a49e blink::DocumentLoader::commitData()
> ...
> 
> This is probably unintended, but it doesn't seem to me that this could cause
> those mystery crashes above. 

Actually, this could be the reason: gin::CreateHandle() takes ownership of the
pointer, so if we end up calling it twice, we have two handles that own the same
pointer. The only thing I don't understand is how that isn't crashing
constantly... :)

(BTW, we also probably need to make sure that we delete the PluginPlaceholder if
its plugin is destroyed before BindWebFrame() has been called, right?)

> The way to fix this double call isn't really
> obvious to me either.

Powered by Google App Engine
This is Rietveld 408576698