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

Issue 194079: renderer process notifications support (Closed)

Created:
11 years, 3 months ago by John Gregg
Modified:
9 years ago
Reviewers:
William Hesse, jam, jorlow
CC:
chromium-reviews_googlegroups.com, michaeln
Visibility:
Public.

Description

This part contains the renderer-side logic for desktop notifications in pages. The code which tracks active notifications (by maintaining a bi-directional map between int notification_ids used on IPC and WebKit notification objects) is put in common because it will be reused by worker notifications in part 2. Also note this patch sets ENABLE_NOTIFICATIONS=1 for the WebKit build, which is necessary to access the conditionally built WebCore objects -- part 1.b. contains a command line flag which will hide notifications from pages by default; that patch is separate to ease review and because it depends on a webkit change (https://bugs.webkit.org/show_bug.cgi?id=28930) Checked in as http://src.chromium.org/viewvc/chrome?view=rev&revision=27973

Patch Set 1 #

Patch Set 2 : lint fixes #

Patch Set 3 : style cleanup in IPC definitions #

Total comments: 53

Patch Set 4 : fix threading issues & style #

Total comments: 31

Patch Set 5 : make hash_map work #

Total comments: 24

Patch Set 6 : address feedback #

Patch Set 7 : "more style changes" #

Total comments: 28

Patch Set 8 : last change for code review #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+426 lines, -4 lines) Patch
M chrome/chrome.gyp View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
A chrome/common/desktop_notifications/active_notification_tracker.h View 1 2 3 5 1 chunk +50 lines, -0 lines 0 comments Download
A chrome/common/desktop_notifications/active_notification_tracker.cc View 1 2 3 4 5 6 7 1 chunk +69 lines, -0 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 7 2 chunks +41 lines, -0 lines 0 comments Download
A chrome/renderer/notification_provider.h View 1 2 3 4 5 6 7 1 chunk +70 lines, -0 lines 0 comments Download
A chrome/renderer/notification_provider.cc View 1 2 3 4 5 6 7 1 chunk +160 lines, -0 lines 1 comment Download
M chrome/renderer/render_view.h View 1 2 3 4 5 6 7 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 5 6 7 4 chunks +5 lines, -0 lines 0 comments Download
M webkit/api/public/WebNotification.h View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download
M webkit/api/src/WebNotification.cpp View 2 chunks +11 lines, -3 lines 0 comments Download
webkit/build/V8Bindings/build-generated-files.sh View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (0 generated)
jorlow
http://codereview.chromium.org/194079/diff/9001/9003 File chrome/common/desktop_notifications/active_notification_tracker.cc (right): http://codereview.chromium.org/194079/diff/9001/9003#newcode8 Line 8: #include "webkit/api/public/WebNotificationPermissionCallback.h" What's the right order? You did ...
11 years, 3 months ago (2009-09-15 20:56:46 UTC) #1
John Gregg
http://codereview.chromium.org/194079/diff/9001/9003 File chrome/common/desktop_notifications/active_notification_tracker.cc (right): http://codereview.chromium.org/194079/diff/9001/9003#newcode8 Line 8: #include "webkit/api/public/WebNotificationPermissionCallback.h" On 2009/09/15 20:56:46, Jeremy Orlow wrote: ...
11 years, 3 months ago (2009-09-17 03:22:00 UTC) #2
jorlow
So my biggest question is whether all of your error handling is really necessary or ...
11 years, 3 months ago (2009-09-18 21:24:01 UTC) #3
John Gregg
http://codereview.chromium.org/194079/diff/9001/9004 File chrome/common/desktop_notifications/active_notification_tracker.h (right): http://codereview.chromium.org/194079/diff/9001/9004#newcode40 Line 40: typedef std::map<WebKit::WebNotification, int>::iterator ReverseTableIterator; > Take a look ...
11 years, 3 months ago (2009-09-18 21:49:52 UTC) #4
jorlow
http://codereview.chromium.org/194079/diff/9001/9004 File chrome/common/desktop_notifications/active_notification_tracker.h (right): http://codereview.chromium.org/194079/diff/9001/9004#newcode40 Line 40: typedef std::map<WebKit::WebNotification, int>::iterator ReverseTableIterator; On 2009/09/18 21:49:52, John ...
11 years, 3 months ago (2009-09-18 21:56:02 UTC) #5
John Gregg
it was a bit of a hassle getting the hash_map to work on both msvc ...
11 years, 3 months ago (2009-09-21 22:40:57 UTC) #6
jorlow
Pretty much done. http://codereview.chromium.org/194079/diff/19001/19003 File chrome/common/desktop_notifications/active_notification_tracker.cc (right): http://codereview.chromium.org/194079/diff/19001/19003#newcode32 Line 32: *notification = *lookup; Do you ...
11 years, 3 months ago (2009-09-24 00:42:16 UTC) #7
brettw
http://codereview.chromium.org/194079/diff/19001/19004 File chrome/common/desktop_notifications/active_notification_tracker.h (right): http://codereview.chromium.org/194079/diff/19001/19004#newcode62 Line 62: #if defined(COMPILER_MSVC) Do we really need a hash_map ...
11 years, 3 months ago (2009-09-25 16:17:33 UTC) #8
John Gregg
I wrote it as a std::map originally, but the concern was raised that std::map isn't ...
11 years, 3 months ago (2009-09-25 16:30:51 UTC) #9
John Gregg
simplified things by going back to std::map, and addressed the style points. http://codereview.chromium.org/194079/diff/19001/19003 File chrome/common/desktop_notifications/active_notification_tracker.cc ...
11 years, 2 months ago (2009-09-28 19:12:56 UTC) #10
jorlow
I'll try to review this today. Please switch back to std::map though, per brettw. http://codereview.chromium.org/194079/diff/19001/19004 ...
11 years, 2 months ago (2009-09-28 20:44:58 UTC) #11
John Gregg
On 2009/09/28 20:44:58, Jeremy Orlow wrote: > I'll try to review this today. Please switch ...
11 years, 2 months ago (2009-09-28 20:46:51 UTC) #12
jorlow
Looks pretty good to me, but it'd be good to have another set of eyes ...
11 years, 2 months ago (2009-09-30 21:22:16 UTC) #13
jorlow
Never mind, Michael. It was the other that I wanted a sanity check on. :-) ...
11 years, 2 months ago (2009-09-30 21:35:45 UTC) #14
John Gregg
http://codereview.chromium.org/194079/diff/28001/28003 File chrome/common/desktop_notifications/active_notification_tracker.cc (right): http://codereview.chromium.org/194079/diff/28001/28003#newcode47 Line 47: WebNotification* notification = notification_table_.Lookup(id); On 2009/09/30 21:35:45, Jeremy ...
11 years, 2 months ago (2009-10-01 16:31:12 UTC) #15
jorlow
LGTM http://codereview.chromium.org/194079/diff/28001/28009 File chrome/renderer/render_view.h (right): http://codereview.chromium.org/194079/diff/28001/28009#newcode33 Line 33: #include "chrome/renderer/notification_provider.h" On 2009/10/01 16:31:12, John Gregg ...
11 years, 2 months ago (2009-10-01 16:38:05 UTC) #16
William Hesse
This change seems to have broken at least the Vista builds, for both trunk and ...
11 years, 2 months ago (2009-10-05 11:13:26 UTC) #17
John Gregg
Is there an error log you can link to? Everything on the build bots seemed ...
11 years, 2 months ago (2009-10-05 15:31:55 UTC) #18
William Hesse
I guess I am looking at the experimental builds, not the waterfall ones. In the ...
11 years, 2 months ago (2009-10-06 09:45:26 UTC) #19
William Hesse
The compile errors that I was worried about are not due to this changelist. I ...
11 years, 2 months ago (2009-10-09 08:35:24 UTC) #20
jam
Sorry I missed this earlier, but this isn't designed correctly (see below). It's currently leading ...
11 years, 2 months ago (2009-10-14 20:33:28 UTC) #21
jam
11 years, 2 months ago (2009-10-14 21:02:45 UTC) #22
Also, it looks like part of the reason that this was missed by other reviewers
is that the default CC list from watchlists was removed.  Please keep it in the
future, as it serves a useful purpose which in this case would have caught this
earlier.

On 2009/10/14 20:33:28, John Abd-El-Malek wrote:
> Sorry I missed this earlier, but this isn't designed correctly (see below). 
> It's currently leading to the number 2 renderer crash.  I think it should be
> reverted in the meantime.
> 
> http://codereview.chromium.org/194079/diff/34001/33006
> File chrome/renderer/notification_provider.cc (right):
> 
> http://codereview.chromium.org/194079/diff/34001/33006#newcode143
> Line 143: if (message.routing_id() != view_->routing_id())
> This isn't thread safe.  IPC::ChannelProxy::MessageFilters run on the IO
thread,
> and I don't see a reason why you need to do this, since all you end up doing
is
> posting a task to the UI thread.  You should just have an object that lives
only
> on the main thread, and that way you don't need to intercept the message on
the
> IO thread only to dispatch it to the UI thread manually.
> 
> RenderView is not thread safe and should only be used on the main thread. 
> There's a race condition here when RenderView is destructed, since the filter
is
> removed via a PostTask.  This is leading to the number 2 renderer crash now:
> http://chromedashboard.mtv.corp.google.com/#view=wincrash

Powered by Google App Engine
This is Rietveld 408576698