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

Unified Diff: chrome/browser/services/gcm/push_messaging_service_impl.cc

Issue 937713004: Push API: Perform exact same-origin test, when checking tab visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippet
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/push_messaging_service_impl.cc
diff --git a/chrome/browser/services/gcm/push_messaging_service_impl.cc b/chrome/browser/services/gcm/push_messaging_service_impl.cc
index d8c543df0f74fa10f18766d3ddee1d239daf0de1..af0b770fdb75166561597f9ddb58983eae124394 100644
--- a/chrome/browser/services/gcm/push_messaging_service_impl.cc
+++ b/chrome/browser/services/gcm/push_messaging_service_impl.cc
@@ -41,7 +41,6 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/platform_notification_data.h"
#include "content/public/common/push_messaging_status.h"
-#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
@@ -351,17 +350,7 @@ void PushMessagingServiceImpl::RequireUserVisibleUX(
// Use the visible URL since that's the one the user is aware of (and it
// doesn't matter whether the page loaded successfully).
const GURL& active_url = active_web_contents->GetVisibleURL();
-
- // Allow https://foo.example.com Service Worker to not show notification
- // if an https://bar.example.com tab is visible (and hence might
- // conceivably be showing UI in response to the push message); but http://
- // doesn't count as the Service Worker can't talk to it, even with
- // navigator.connect.
- if (requesting_origin.scheme() != active_url.scheme())
- continue;
- if (net::registry_controlled_domains::SameDomainOrHost(
- requesting_origin, active_url,
- net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)) {
+ if (requesting_origin == active_url.GetOrigin()) {
notification_needed = false;
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698