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

Issue 317823007: Hook PushMessagingMessageFilter up to GCMDriver (Closed)

Created:
6 years, 6 months ago by johnme
Modified:
6 years, 6 months ago
CC:
chromium-reviews, darin-cc_chromium.org, nasko+codewatch_chromium.org, creis+watch_chromium.org
Visibility:
Public.

Description

Hook PushMessagingMessageFilter up to GCMDriver Add plumbing for registration from push service-agnostic content layer to GCMDriver in chrome layer. To achieve this, GCMProfileService owns an implementation of a new PushMessagingService class, which can be used from the content layer. Based on mvanouwerkerk's prototype in https://codereview.chromium.org/186023002, but significantly refactored. BUG=350384 TBR=benm@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276792 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277016

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use BrowserContext instead of ContentBrowserClient #

Patch Set 3 : Add TODO #

Total comments: 9

Patch Set 4 : Address jianli's comments #

Patch Set 5 : Make push_messaging_service non-const #

Total comments: 6

Patch Set 6 : Address fgorski's comments #

Patch Set 7 : Rebase #

Patch Set 8 : Make DidRegister private #

Patch Set 9 : Rebase #

Patch Set 10 : Send failure IPC when service is NULL #

Unified diffs Side-by-side diffs Delta from patch set Stats (+249 lines, -17 lines) Patch
M android_webview/browser/aw_browser_context.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/browser/aw_browser_context.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/services/gcm/gcm_profile_service.h View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/services/gcm/gcm_profile_service.cc View 1 2 3 4 5 6 3 chunks +7 lines, -3 lines 0 comments Download
A chrome/browser/services/gcm/push_messaging_service_impl.h View 1 2 3 4 5 6 7 1 chunk +43 lines, -0 lines 0 comments Download
A chrome/browser/services/gcm/push_messaging_service_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +46 lines, -0 lines 0 comments Download
M chrome/browser/ui/app_list/test/fake_profile.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/app_list/test/fake_profile.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/push_messaging_message_filter.h View 1 2 3 4 5 6 7 8 9 2 chunks +16 lines, -2 lines 0 comments Download
M content/browser/push_messaging_message_filter.cc View 1 2 3 4 5 6 7 8 9 3 chunks +45 lines, -11 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/browser_context.h View 1 2 chunks +6 lines, -0 lines 0 comments Download
A content/public/browser/push_messaging_service.h View 1 2 3 4 5 6 7 8 9 1 chunk +33 lines, -0 lines 0 comments Download
M content/public/test/test_browser_context.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/test_browser_context.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/shell/browser/shell_browser_context.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/browser/shell_browser_context.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
johnme
Jian and/or Filip, can you review the chrome/browser/services/gcm parts, and also check that the general ...
6 years, 6 months ago (2014-06-05 19:15:55 UTC) #1
jochen (gone - plz use gerrit)
+mvanouwerkerk s/getting/getter/ https://codereview.chromium.org/317823007/diff/1/content/public/browser/content_browser_client.cc File content/public/browser/content_browser_client.cc (right): https://codereview.chromium.org/317823007/diff/1/content/public/browser/content_browser_client.cc#newcode244 content/public/browser/content_browser_client.cc:244: BrowserContext* browser_context) { why not add a ...
6 years, 6 months ago (2014-06-06 07:05:38 UTC) #2
Michael van Ouwerkerk
https://codereview.chromium.org/317823007/diff/1/content/browser/push_messaging_message_filter.cc File content/browser/push_messaging_message_filter.cc (right): https://codereview.chromium.org/317823007/diff/1/content/browser/push_messaging_message_filter.cc#newcode54 content/browser/push_messaging_message_filter.cc:54: DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); Looks like we really do everything on the ...
6 years, 6 months ago (2014-06-06 10:43:30 UTC) #3
johnme
On 2014/06/06 07:05:38, jochen traveling until Jun 23 wrote: > https://codereview.chromium.org/317823007/diff/1/content/public/browser/content_browser_client.cc > File content/public/browser/content_browser_client.cc (right): ...
6 years, 6 months ago (2014-06-06 13:31:43 UTC) #4
Michael van Ouwerkerk
lgtm https://codereview.chromium.org/317823007/diff/40001/content/public/browser/browser_context.h File content/public/browser/browser_context.h (right): https://codereview.chromium.org/317823007/diff/40001/content/public/browser/browser_context.h#newcode191 content/public/browser/browser_context.h:191: virtual PushMessagingService* GetPushMessagingService() = 0; It seems we ...
6 years, 6 months ago (2014-06-06 13:42:46 UTC) #5
johnme
https://codereview.chromium.org/317823007/diff/40001/content/public/browser/browser_context.h File content/public/browser/browser_context.h (right): https://codereview.chromium.org/317823007/diff/40001/content/public/browser/browser_context.h#newcode191 content/public/browser/browser_context.h:191: virtual PushMessagingService* GetPushMessagingService() = 0; On 2014/06/06 13:42:46, Michael ...
6 years, 6 months ago (2014-06-06 14:17:54 UTC) #6
jianli
https://codereview.chromium.org/317823007/diff/40001/chrome/browser/services/gcm/gcm_profile_service.h File chrome/browser/services/gcm/gcm_profile_service.h (right): https://codereview.chromium.org/317823007/diff/40001/chrome/browser/services/gcm/gcm_profile_service.h#newcode58 chrome/browser/services/gcm/gcm_profile_service.h:58: content::PushMessagingService* push_messaging_service() { nit: add const modifier https://codereview.chromium.org/317823007/diff/40001/chrome/browser/services/gcm/push_messaging_service_impl.cc File ...
6 years, 6 months ago (2014-06-06 17:32:21 UTC) #7
johnme
Thanks, done. https://codereview.chromium.org/317823007/diff/40001/chrome/browser/services/gcm/gcm_profile_service.h File chrome/browser/services/gcm/gcm_profile_service.h (right): https://codereview.chromium.org/317823007/diff/40001/chrome/browser/services/gcm/gcm_profile_service.h#newcode58 chrome/browser/services/gcm/gcm_profile_service.h:58: content::PushMessagingService* push_messaging_service() { On 2014/06/06 17:32:20, jianli ...
6 years, 6 months ago (2014-06-06 18:48:25 UTC) #8
fgorski
gcm parts look ok. Please apply comments. https://codereview.chromium.org/317823007/diff/80001/chrome/browser/services/gcm/push_messaging_service_impl.cc File chrome/browser/services/gcm/push_messaging_service_impl.cc (right): https://codereview.chromium.org/317823007/diff/80001/chrome/browser/services/gcm/push_messaging_service_impl.cc#newcode33 chrome/browser/services/gcm/push_messaging_service_impl.cc:33: base::Unretained(this), This ...
6 years, 6 months ago (2014-06-09 17:43:49 UTC) #9
johnme
Addresses Filip's comments - thanks! https://codereview.chromium.org/317823007/diff/40001/chrome/browser/services/gcm/gcm_profile_service.h File chrome/browser/services/gcm/gcm_profile_service.h (right): https://codereview.chromium.org/317823007/diff/40001/chrome/browser/services/gcm/gcm_profile_service.h#newcode58 chrome/browser/services/gcm/gcm_profile_service.h:58: content::PushMessagingService* push_messaging_service() { On ...
6 years, 6 months ago (2014-06-09 19:04:46 UTC) #10
fgorski
lgtm
6 years, 6 months ago (2014-06-09 23:11:10 UTC) #11
jianli
lgtm
6 years, 6 months ago (2014-06-09 23:22:10 UTC) #12
jochen (gone - plz use gerrit)
lgtm
6 years, 6 months ago (2014-06-12 14:52:31 UTC) #13
johnme
The CQ bit was checked by johnme@chromium.org
6 years, 6 months ago (2014-06-12 16:27:34 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/johnme@chromium.org/317823007/160001
6 years, 6 months ago (2014-06-12 16:30:06 UTC) #15
commit-bot: I haz the power
Change committed as 276792
6 years, 6 months ago (2014-06-12 20:43:08 UTC) #16
Dirk Pranke
On 2014/06/12 20:43:08, I haz the power (commit-bot) wrote: > Change committed as 276792 Unfortunately, ...
6 years, 6 months ago (2014-06-12 22:40:40 UTC) #17
Dirk Pranke
On 2014/06/12 22:40:40, Dirk Pranke wrote: > On 2014/06/12 20:43:08, I haz the power (commit-bot) ...
6 years, 6 months ago (2014-06-12 23:01:28 UTC) #18
johnme
The CQ bit was checked by johnme@chromium.org
6 years, 6 months ago (2014-06-13 11:53:24 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/johnme@chromium.org/317823007/180001
6 years, 6 months ago (2014-06-13 11:54:42 UTC) #20
commit-bot: I haz the power
Change committed as 277016
6 years, 6 months ago (2014-06-13 14:43:43 UTC) #21
jam
why is any of this code in content? this appears to be a chrome/google specific ...
6 years, 6 months ago (2014-06-15 03:23:24 UTC) #22
Michael van Ouwerkerk
On 2014/06/15 03:23:24, jam wrote: > why is any of this code in content? this ...
6 years, 6 months ago (2014-06-15 19:47:20 UTC) #23
jam
On 2014/06/15 19:47:20, Michael van Ouwerkerk wrote: > On 2014/06/15 03:23:24, jam wrote: > > ...
6 years, 6 months ago (2014-06-16 06:41:33 UTC) #24
Michael van Ouwerkerk
6 years, 6 months ago (2014-06-17 13:29:57 UTC) #25
Message was sent while issue was closed.
On 2014/06/16 06:41:33, jam wrote:
> On 2014/06/15 19:47:20, Michael van Ouwerkerk wrote:
> > On 2014/06/15 03:23:24, jam wrote:
> > > why is any of this code in content? this appears to be a chrome/google
> > specific
> > > feature, i.e. not the web platform. so it should belong completely in
> chrome.
> > > see http://www.chromium.org/developers/content-module
> > 
> > John, the Push API is a W3C draft standard: https://w3c.github.io/push-api/
> > 
> > The implementation uses GCM, but the GCM bits are not in the content layer.
> > There are some more details in the design document:
> >
>
https://docs.google.com/a/chromium.org/document/d/1-YTIsnKfLfqELO54vo-lz3WaW2...
> 
> oh i see, thanks for the links. I hadn't seen any of these in the linked bug,
> and only mention of chrome.
> 
> questions: why is there push_messaging_service with just one method? i.e. why
> isn't this on BrowserContext?
> Also on the renderer side, I see virtual blink::WebPushClient*
webPushClient();
> on RenderViewImpl. This should be on RenderFrameImpl, as that's where we're
> moving existing stuff off as part of site isolation. Since
> WebView/WebViewClient/RenderView are eventually going away, new interfaces
like
> this should go on the new place initially instead of the old place and then
> having to convert them later.

John: there will be more methods for the other JavaScript calls: unregister(),
isRegistered(), and hasPermission().

You are right, we have to port this to RenderFrameImpl. This is a leftover from
the earliest commits and prototypes, which were done when the pattern for using
RenderFrameImpl was not clear yet.

Powered by Google App Engine
This is Rietveld 408576698