diff options
author | Peter Beverloo <peter@chromium.org> | 2014-11-14 13:26:32 +0000 |
---|---|---|
committer | Peter Beverloo <peter@chromium.org> | 2014-11-14 13:27:42 +0000 |
commit | c8e8291180910b86709d5186c1fd3a934335954c (patch) | |
tree | 1da8cfb28423830c3e00691010ba235ffe30d299 | |
parent | 1fa6c42cee1471df2a3f3e383472267f3819497a (diff) | |
download | chromium_src-c8e8291180910b86709d5186c1fd3a934335954c.zip chromium_src-c8e8291180910b86709d5186c1fd3a934335954c.tar.gz chromium_src-c8e8291180910b86709d5186c1fd3a934335954c.tar.bz2 |
Include Web Notifications as an experimental feature on Android (M40).
This also makes the case where we can't find the closure
callback fail silently rather than NOTREACHEDing. This is race
which we can end up in more easily on Android. The new Notification
code-path has better protections against this.
BUG=90795, 386049, 431790
TBR=matthewyuan@chromium.org
Review URL: https://codereview.chromium.org/695913002
Cr-Commit-Position: refs/heads/master@{#303497}
(cherry picked from commit c8958a08ef28b0be3497642d669113f149ce6ace)
Review URL: https://codereview.chromium.org/726903002
Cr-Commit-Position: refs/branch-heads/2214@{#42}
Cr-Branched-From: 03655fd3f6d72165dc3c9bd2c89807305316fe6c-refs/heads/master@{#303346}
-rw-r--r-- | content/browser/frame_host/render_frame_host_impl.cc | 5 | ||||
-rw-r--r-- | content/child/runtime_features.cc | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index f66fad6..a589114 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc @@ -1035,10 +1035,9 @@ void RenderFrameHostImpl::OnShowDesktopNotification( } void RenderFrameHostImpl::OnCancelDesktopNotification(int notification_id) { - if (!cancel_notification_callbacks_.count(notification_id)) { - NOTREACHED(); + if (!cancel_notification_callbacks_.count(notification_id)) return; - } + cancel_notification_callbacks_[notification_id].Run(); cancel_notification_callbacks_.erase(notification_id); } diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 1651927..891e22b 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc @@ -114,6 +114,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( if (!command_line.HasSwitch(switches::kEnableSpeechRecognition)) WebRuntimeFeatures::enableScriptedSpeech(false); + if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) + WebRuntimeFeatures::enableNotifications(true); + // WebAudio is enabled by default on ARM and X86, if the MediaCodec // API is available. WebRuntimeFeatures::enableWebAudio( |