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

Issue 11826005: Browser Plugin: Implement BrowserPluginObserver. (Closed)

Created:
7 years, 11 months ago by Fady Samuel
Modified:
7 years, 5 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, Matt Perry
Visibility:
Public.

Description

Browser Plugin: Implement BrowserPluginObserver. The major changes in this CL are: - Refactors BrowserPlugin to BrowserPlugin in content/public and BrowserPluginImpl. - Refactors BrowserPluginBindings, moving out method and property bindings to content/public. - Introduces BrowserPluginObserver, and adds an observer list to BrowserPluginImpl. - Messages sent to BrowserPlugin from outside are encapsulated in another message that takes care of the instance ID routing BrowserPlugin*Msg_ForwardMessage. BUG=166165 Test=BrowserPluginHostTest.*, BrowserPluginTest.*

Patch Set 1 #

Total comments: 41

Patch Set 2 : Merged with ToT + Addressed comments #

Patch Set 3 : Merged with ToT. BrowserPluginObserver messages are now wrapped in another message. #

Patch Set 4 : BrowserPluginImpl::Send should only be used by observers #

Patch Set 5 : Merge with ToT #

Patch Set 6 : Fixed tests #

Patch Set 7 : Remove old browser_plugin.{h, cc} #

Patch Set 8 : Fixed extra includes #

Patch Set 9 : Clean up bindings API #

Total comments: 16

Patch Set 10 : Addressed comments #

Patch Set 11 : Merge with ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+969 lines, -2326 lines) Patch
M content/common/browser_plugin_messages.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +11 lines, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -2 lines 0 comments Download
A content/public/renderer/browser_plugin/browser_plugin.h View 1 2 3 4 5 6 7 8 9 1 chunk +82 lines, -0 lines 0 comments Download
A content/public/renderer/browser_plugin/browser_plugin_method_binding.h View 1 2 3 4 5 6 7 8 9 1 chunk +38 lines, -0 lines 0 comments Download
A content/public/renderer/browser_plugin/browser_plugin_observer.h View 1 2 3 4 5 6 7 8 9 1 chunk +53 lines, -0 lines 0 comments Download
A content/public/renderer/browser_plugin/browser_plugin_observer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +51 lines, -0 lines 0 comments Download
A content/public/renderer/browser_plugin/browser_plugin_property_binding.h View 1 2 3 4 5 6 7 8 9 1 chunk +42 lines, -0 lines 0 comments Download
M content/public/renderer/content_renderer_client.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
D content/renderer/browser_plugin/browser_plugin.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -410 lines 0 comments Download
D content/renderer/browser_plugin/browser_plugin.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1337 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_bindings.h View 1 2 3 4 3 chunks +11 lines, -4 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_bindings.cc View 1 2 3 4 5 6 7 8 9 10 25 chunks +298 lines, -300 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
A + content/renderer/browser_plugin/browser_plugin_impl.h View 1 2 3 4 5 6 7 8 9 10 9 chunks +50 lines, -31 lines 0 comments Download
A + content/renderer/browser_plugin/browser_plugin_impl.cc View 1 2 3 4 5 6 7 8 9 10 58 chunks +273 lines, -205 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager.h View 1 2 3 4 3 chunks +15 lines, -6 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager.cc View 1 2 3 4 3 chunks +6 lines, -4 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager_impl.h View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +10 lines, -9 lines 0 comments Download
M content/renderer/browser_plugin/mock_browser_plugin.h View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M content/renderer/browser_plugin/mock_browser_plugin.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/browser_plugin/mock_browser_plugin_manager.h View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/browser_plugin/mock_browser_plugin_manager.cc View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Fady Samuel
7 years, 11 months ago (2013-01-08 20:55:24 UTC) #1
Fady Samuel
+jam@ for content/public changes.
7 years, 11 months ago (2013-01-08 23:50:13 UTC) #2
sadrul
https://codereview.chromium.org/11826005/diff/1/content/public/renderer/browser_plugin/browser_plugin.h File content/public/renderer/browser_plugin/browser_plugin.h (right): https://codereview.chromium.org/11826005/diff/1/content/public/renderer/browser_plugin/browser_plugin.h#newcode20 content/public/renderer/browser_plugin/browser_plugin.h:20: virtual void AddMethodBinding(BrowserPluginMethodBinding* method_binding) = 0; doc the methods, ...
7 years, 11 months ago (2013-01-09 15:21:54 UTC) #3
sadrul
Also, you could change the CL description (to something like: The major changes in this ...
7 years, 11 months ago (2013-01-09 15:23:53 UTC) #4
Fady Samuel
PTAL https://codereview.chromium.org/11826005/diff/1/content/public/renderer/browser_plugin/browser_plugin.h File content/public/renderer/browser_plugin/browser_plugin.h (right): https://codereview.chromium.org/11826005/diff/1/content/public/renderer/browser_plugin/browser_plugin.h#newcode20 content/public/renderer/browser_plugin/browser_plugin.h:20: virtual void AddMethodBinding(BrowserPluginMethodBinding* method_binding) = 0; On 2013/01/09 ...
7 years, 11 months ago (2013-01-09 17:41:24 UTC) #5
sadrul
LGTM https://codereview.chromium.org/11826005/diff/1/content/public/renderer/browser_plugin/browser_plugin_observer.cc File content/public/renderer/browser_plugin/browser_plugin_observer.cc (right): https://codereview.chromium.org/11826005/diff/1/content/public/renderer/browser_plugin/browser_plugin_observer.cc#newcode51 content/public/renderer/browser_plugin/browser_plugin_observer.cc:51: browser_plugin_ = NULL; On 2013/01/09 17:41:24, Fady Samuel ...
7 years, 11 months ago (2013-01-09 17:58:07 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/11826005/6002
7 years, 11 months ago (2013-01-09 17:59:46 UTC) #7
commit-bot: I haz the power
Presubmit check for 11826005-6002 failed and returned exit status 1. Running presubmit commit checks ...
7 years, 11 months ago (2013-01-09 17:59:56 UTC) #8
jam
I need to find a block of time to understand all this. my first impression ...
7 years, 11 months ago (2013-01-09 19:10:03 UTC) #9
Fady Samuel
On 2013/01/09 19:10:03, John Abd-El-Malek wrote: > I need to find a block of time ...
7 years, 11 months ago (2013-01-09 19:16:07 UTC) #10
jam
On 2013/01/09 19:16:07, Fady Samuel wrote: > On 2013/01/09 19:10:03, John Abd-El-Malek wrote: > > ...
7 years, 11 months ago (2013-01-09 22:07:12 UTC) #11
Fady Samuel
On 2013/01/09 22:07:12, John Abd-El-Malek wrote: > On 2013/01/09 19:16:07, Fady Samuel wrote: > > ...
7 years, 11 months ago (2013-01-09 22:10:48 UTC) #12
Fady Samuel
On 2013/01/09 22:10:48, Fady Samuel wrote: > On 2013/01/09 22:07:12, John Abd-El-Malek wrote: > > ...
7 years, 11 months ago (2013-01-09 23:02:53 UTC) #13
Fady Samuel
On 2013/01/09 22:10:48, Fady Samuel wrote: > On 2013/01/09 22:07:12, John Abd-El-Malek wrote: > > ...
7 years, 11 months ago (2013-01-09 23:02:53 UTC) #14
Fady Samuel
After our chat John, I've removed the need for RequestMessage inside observers. I wrap all ...
7 years, 11 months ago (2013-01-11 16:44:11 UTC) #15
Fady Samuel
+creis for reference after a VC conversation: This is the embedder-side refactor that will permit ...
7 years, 10 months ago (2013-02-21 20:10:12 UTC) #16
Fady Samuel
+creis [-everyone else]: Hi Charlie, This is the first step towards moving out all the ...
7 years, 10 months ago (2013-02-26 20:31:45 UTC) #17
Fady Samuel
+lazyboy@ for a look at this as well.
7 years, 10 months ago (2013-02-26 22:43:46 UTC) #18
Charlie Reis
I'm very happy about where this is headed. It will be nice to move the ...
7 years, 9 months ago (2013-02-28 02:12:03 UTC) #19
Fady Samuel
7 years, 9 months ago (2013-02-28 22:56:21 UTC) #20
Addressed comments

+jam for thoughts

https://codereview.chromium.org/11826005/diff/37026/content/common/browser_pl...
File content/common/browser_plugin_messages.h (right):

https://codereview.chromium.org/11826005/diff/37026/content/common/browser_pl...
content/common/browser_plugin_messages.h:136: // BrowserPluginGuestObservers.
On 2013/02/28 02:12:03, creis wrote:
> I'm not sure if this is ok from a security perspective, but I suppose you'll
> need a security reviewer for this file anyway.
> 
> Why do you need to forward an entire IPC message?  What's an example?

See https://chromiumcodereview.appspot.com/12326168/

This idea was suggested to me by John. I believe this is done elsewhere in the
code. This hides the notion of instance ID from the chrome layer and
BrowserPluginObserver. Messages automagically get to the right place without
needing to know anything about how they're routed there.

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
File content/public/renderer/browser_plugin/browser_plugin.h (right):

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
content/public/renderer/browser_plugin/browser_plugin.h:1: // Copyright (c) 2012
The Chromium Authors. All rights reserved.
On 2013/02/28 02:12:03, creis wrote:
> 2013 for new files.

Done.

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
content/public/renderer/browser_plugin/browser_plugin.h:28: class CONTENT_EXPORT
BrowserPlugin : public IPC::Sender {
On 2013/02/28 02:12:03, creis wrote:
> Please add class-level documentation for this concept.

Done.

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
content/public/renderer/browser_plugin/browser_plugin.h:46: virtual RenderView*
GetRenderView() const = 0;
On 2013/02/28 02:12:03, creis wrote:
> GetRenderView and GetContainer seem like a different category than the others.

> Can you move them above AddMethodBinding?

Done.

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
File content/public/renderer/browser_plugin/browser_plugin_method_binding.h
(right):

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
content/public/renderer/browser_plugin/browser_plugin_method_binding.h:17: class
CONTENT_EXPORT BrowserPluginMethodBinding {
On 2013/02/28 02:12:03, creis wrote:
> Class-level documentation.

Done.

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
File content/public/renderer/browser_plugin/browser_plugin_observer.h (right):

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
content/public/renderer/browser_plugin/browser_plugin_observer.h:1: // Copyright
(c) 2012 The Chromium Authors. All rights reserved.
On 2013/02/28 02:12:03, creis wrote:
> 2013 for new files.

Done.

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
content/public/renderer/browser_plugin/browser_plugin_observer.h:18: // Base
class for objects taht want to filter incoming IPCs.
On 2013/02/28 02:12:03, creis wrote:
> nit: that
> 
> I'm a bit surprised that this is about IPC messages.  I was expecting
something
> more like RenderViewObserver, which exposes semantic events.  Then again, I'm
> not sure how you're expecting to use this.
> 
> I'll defer to John's opinion on this, though.

Fixed nit.

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
File content/public/renderer/browser_plugin/browser_plugin_property_binding.h
(right):

https://codereview.chromium.org/11826005/diff/37026/content/public/renderer/b...
content/public/renderer/browser_plugin/browser_plugin_property_binding.h:17:
class CONTENT_EXPORT BrowserPluginPropertyBinding {
On 2013/02/28 02:12:03, creis wrote:
> Class-level documentation.

Done.

Powered by Google App Engine
This is Rietveld 408576698