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

Issue 10965017: Browser Plugin: Implement getProcessId (Closed)

Created:
8 years, 3 months ago by Fady Samuel
Modified:
8 years, 3 months ago
Reviewers:
Charlie Reis, lazyboy
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Browser Plugin: Implement getProcessId When we commit a navigation, we forward the RenderProcessHost ID to the Browser Plugin in the embedder so that we can query it via getProcessId() BUG=151212 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=157994

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fixed Nits #

Total comments: 8

Patch Set 3 : Fixed nits #

Patch Set 4 : Merged with ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -23 lines) Patch
M content/browser/browser_plugin/browser_plugin_guest.cc View 1 2 3 4 chunks +7 lines, -5 lines 0 comments Download
M content/common/browser_plugin_messages.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin.h View 1 2 3 3 chunks +4 lines, -1 line 0 comments Download
M content/renderer/browser_plugin/browser_plugin.cc View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_bindings.cc View 1 2 3 5 chunks +23 lines, -8 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_browsertest.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_browsertest.cc View 1 2 3 3 chunks +16 lines, -2 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager_impl.cc View 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Fady Samuel
8 years, 3 months ago (2012-09-20 19:10:11 UTC) #1
lazyboy
Sending nits and one possible assert to add in tests. https://chromiumcodereview.appspot.com/10965017/diff/1/content/browser/browser_plugin/browser_plugin_guest.cc File content/browser/browser_plugin/browser_plugin_guest.cc (right): https://chromiumcodereview.appspot.com/10965017/diff/1/content/browser/browser_plugin/browser_plugin_guest.cc#newcode254 ...
8 years, 3 months ago (2012-09-20 19:47:04 UTC) #2
Fady Samuel
https://codereview.chromium.org/10965017/diff/1/content/browser/browser_plugin/browser_plugin_guest.cc File content/browser/browser_plugin/browser_plugin_guest.cc (right): https://codereview.chromium.org/10965017/diff/1/content/browser/browser_plugin/browser_plugin_guest.cc#newcode254 content/browser/browser_plugin/browser_plugin_guest.cc:254: DCHECK(embedder_render_process_host()); On 2012/09/20 19:47:04, lazyboy wrote: > Sorry, this ...
8 years, 3 months ago (2012-09-20 21:58:05 UTC) #3
Fady Samuel
8 years, 3 months ago (2012-09-20 21:58:06 UTC) #4
Charlie Reis
LGTM with nits. https://codereview.chromium.org/10965017/diff/3002/content/browser/browser_plugin/browser_plugin_guest.cc File content/browser/browser_plugin/browser_plugin_guest.cc (right): https://codereview.chromium.org/10965017/diff/3002/content/browser/browser_plugin/browser_plugin_guest.cc#newcode258 content/browser/browser_plugin/browser_plugin_guest.cc:258: render_view_host->GetProcess()->GetID())); Interesting that we're piggy-backing on ...
8 years, 3 months ago (2012-09-21 00:24:06 UTC) #5
Fady Samuel
8 years, 3 months ago (2012-09-21 14:48:46 UTC) #6
Fixed nits. Landing once tree is green.

https://codereview.chromium.org/10965017/diff/3002/content/browser/browser_pl...
File content/browser/browser_plugin/browser_plugin_guest.cc (right):

https://codereview.chromium.org/10965017/diff/3002/content/browser/browser_pl...
content/browser/browser_plugin/browser_plugin_guest.cc:258:
render_view_host->GetProcess()->GetID()));
On 2012/09/21 00:24:06, creis wrote:
> Interesting that we're piggy-backing on navigation commits, but I think that's
a
> reasonable time to do it.  I don't see a strong need for apps to be notified
as
> soon as the process is created, unless we later want to help them make very
> fine-grained task managers.
> 
> I think this approach will work fine for the foreseeable future.

Each navigation has the potential to be to a new process (in the future), so I
thought that we might as well do this.

https://codereview.chromium.org/10965017/diff/3002/content/renderer/browser_p...
File content/renderer/browser_plugin/browser_plugin.cc (right):

https://codereview.chromium.org/10965017/diff/3002/content/renderer/browser_p...
content/renderer/browser_plugin/browser_plugin.cc:62: process_id_(0) {
On 2012/09/21 00:24:06, creis wrote:
> -1, perhaps?  I believe 0 refers to the browser process.

Done.

https://codereview.chromium.org/10965017/diff/3002/content/renderer/browser_p...
File content/renderer/browser_plugin/browser_plugin.h (right):

https://codereview.chromium.org/10965017/diff/3002/content/renderer/browser_p...
content/renderer/browser_plugin/browser_plugin.h:38: // Returns the process ID
of the current guest.
On 2012/09/21 00:24:06, creis wrote:
> nit: Chrome's process ID.
> (Just want to distinguish between that and the OS process ID, which may change
> after a crash.  Chrome's process ID stays stable, barring any cross-process
> navigations.)

Done.

https://codereview.chromium.org/10965017/diff/3002/content/renderer/browser_p...
File content/renderer/browser_plugin/browser_plugin_bindings.cc (right):

https://codereview.chromium.org/10965017/diff/3002/content/renderer/browser_p...
content/renderer/browser_plugin/browser_plugin_bindings.cc:42: const char
kGetProcessID[] = "getProcessId";
On 2012/09/21 00:24:06, creis wrote:
> Ah, the lowercase "d" in ID.  How I hate that convention.  :)  It's correct,
> though!
> 
> Maybe make the constant name consistent with it?

Done.

Powered by Google App Engine
This is Rietveld 408576698