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

Issue 2828503005: Add NotificationDisplayServiceProxy (Closed)

Created:
3 years, 8 months ago by Tom (Use chromium acct)
Modified:
3 years, 8 months ago
CC:
chromium-reviews, Peter Beverloo, mlamouri+watch-notifications_chromium.org, awdf+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add NotificationDisplayServiceProxy BUG=676220 R=thestig@chromium.org,peter@chromium.org

Patch Set 1 #

Total comments: 14

Patch Set 2 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -45 lines) Patch
M chrome/browser/BUILD.gn View 1 2 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/notifications/notification_display_service_factory.cc View 2 chunks +9 lines, -4 lines 0 comments Download
A chrome/browser/notifications/notification_display_service_proxy.h View 1 chunk +53 lines, -0 lines 0 comments Download
A chrome/browser/notifications/notification_display_service_proxy.cc View 1 chunk +102 lines, -0 lines 0 comments Download
M chrome/browser/notifications/notification_platform_bridge_linux.h View 1 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/notifications/notification_platform_bridge_linux.cc View 1 7 chunks +39 lines, -29 lines 0 comments Download
M chrome/common/features.gni View 1 1 chunk +1 line, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 4 (1 generated)
Tom (Use chromium acct)
thestig and peter ptal Hopefully this CL should ground some discussion about the async initialization. ...
3 years, 8 months ago (2017-04-19 01:44:20 UTC) #1
Peter Beverloo
A few comments inline. I have a preference of coalescing this into the NativeNotificationDisplayService, changing ...
3 years, 8 months ago (2017-04-19 13:26:41 UTC) #2
Tom (Use chromium acct)
3 years, 8 months ago (2017-04-20 01:43:47 UTC) #3
Closing this CL (too many merge conflicts) and merging into
https://codereview.chromium.org/2821533003/

On 2017/04/19 13:26:41, Peter Beverloo wrote:
> A few comments inline. I have a preference of coalescing this into the
> NativeNotificationDisplayService, changing the assumption that initialising
the
> NotificationPlatformBridge can be synchronous.
> 

Done.

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
File chrome/browser/notifications/notification_display_service.h (right):

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
chrome/browser/notifications/notification_display_service.h:45: virtual void
GetDisplayed(const DisplayedNotificationsCallback& callback) = 0;
On 2017/04/19 13:26:41, Peter Beverloo wrote:
> You probably have to rebase at some point - the `const` qualifiers went over a
> week ago.
> 
> https://codereview.chromium.org/2813943002/

Rebased.

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
File chrome/browser/notifications/notification_display_service_proxy.cc (right):

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
chrome/browser/notifications/notification_display_service_proxy.cc:19: auto*
npbl = static_cast<NotificationPlatformBridgeLinux*>(
On 2017/04/19 13:26:41, Peter Beverloo wrote:
> Here and elsewhere (impls, nds, etc) - Chromium style has a reasonably strong
> dislike towards using acronyms for identifiers. Maybe substitute like:
> 
> npbl -> platform_bridge_linux
> impls -> implementations
> nds -> display_service

Done.

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
chrome/browser/notifications/notification_display_service_proxy.cc:23:
base::Unretained(this)));
On 2017/04/19 13:26:41, Peter Beverloo wrote:
> There's two race conditions here:
> 
>   (1) We can hit the DCHECK on notification_platform_bridge_linux.cc:269 when
> multiple profiles are being initialised at once.

Good catch, fixed!

>   (2) Super unlikely, but |this| may not outlive the |npbl|. Use a WeakPtr?

Done.

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
chrome/browser/notifications/notification_display_service_proxy.cc:50: //
TODO(thomasanderson): clean up |g_browser_process->notification_bridge_|?
On 2017/04/19 13:26:41, Peter Beverloo wrote:
> Can the NPBL just stop its own thread when it identifies that the object proxy
> cannot be obtained?

Done.

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
chrome/browser/notifications/notification_display_service_proxy.cc:82:
notification_type, notification_id, notification));
On 2017/04/19 13:26:41, Peter Beverloo wrote:
> Instead of this pattern, consider something like:
> 
> =========================
> if (initialized) {
>   GetNotificationDisplayService()->Display(..);
>   return;
> }
> 
> QueueTask(base::Bind(&NotificationDisplayServiceProxy::Display,
>                      base::Unretained(this), ...));
> =========================
> 
> That'll avoid having to copy all the arguments in the common case, as well as
> the closures. See e.g. the GCMDelayedTaskController for an application of
this.

Done.

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
File chrome/browser/notifications/notification_display_service_proxy.h (right):

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
chrome/browser/notifications/notification_display_service_proxy.h:8: #include
<queue>
On 2017/04/19 13:26:41, Peter Beverloo wrote:
> #include <memory>
> #include "base/callback.h"
> class Profile;
> 
> (iwyu)

Done.

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
File chrome/browser/notifications/notification_platform_bridge_linux.h (right):

https://codereview.chromium.org/2828503005/diff/1/chrome/browser/notification...
chrome/browser/notifications/notification_platform_bridge_linux.h:32: void
IsConnected(const base::Callback<void(bool)>& callback);
On 2017/04/19 13:26:41, Peter Beverloo wrote:
> nit: there's a bunch of massive refactoring CLs in flight where people update
> base::Callback to base::OnceCallback. Looks like the semantics of this
qualify.

Done.

Powered by Google App Engine
This is Rietveld 408576698