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

Unified Diff: chrome/browser/push_messaging/push_messaging_service_impl.cc

Issue 1141613003: Push API: Include origin in generated app_ids (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ident_test
Patch Set: Simplify DCHECKs Created 5 years, 7 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 | « chrome/browser/push_messaging/push_messaging_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/push_messaging/push_messaging_service_impl.cc
diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.cc b/chrome/browser/push_messaging/push_messaging_service_impl.cc
index 06debd70ae59e06e8ff169320a5c3ac0f67e5645..bfb8dea7b1b88605ed40485972676a28317876e9 100644
--- a/chrome/browser/push_messaging/push_messaging_service_impl.cc
+++ b/chrome/browser/push_messaging/push_messaging_service_impl.cc
@@ -145,7 +145,7 @@ void PushMessagingServiceImpl::DecreasePushRegistrationCount(int subtract,
}
bool PushMessagingServiceImpl::CanHandle(const std::string& app_id) const {
- return !PushMessagingAppIdentifier::Get(profile_, app_id).is_null();
+ return !PushMessagingAppIdentifier::FindByAppId(profile_, app_id).is_null();
}
void PushMessagingServiceImpl::ShutdownHandler() {
@@ -163,7 +163,7 @@ void PushMessagingServiceImpl::OnMessage(
message_callback_for_testing_.is_null() ? base::Bind(&base::DoNothing)
: message_callback_for_testing_;
PushMessagingAppIdentifier app_identifier =
- PushMessagingAppIdentifier::Get(profile_, app_id);
+ PushMessagingAppIdentifier::FindByAppId(profile_, app_id);
// Drop message and unregister if app_id was unknown (maybe recently deleted).
if (app_identifier.is_null()) {
DeliverMessageCallback(app_id, GURL::EmptyGURL(), -1, message,
@@ -469,8 +469,9 @@ void PushMessagingServiceImpl::Unregister(
int64 service_worker_registration_id,
const std::string& sender_id,
const content::PushMessagingService::UnregisterCallback& callback) {
- PushMessagingAppIdentifier app_identifier = PushMessagingAppIdentifier::Get(
- profile_, requesting_origin, service_worker_registration_id);
+ PushMessagingAppIdentifier app_identifier =
+ PushMessagingAppIdentifier::FindByServiceWorker(
+ profile_, requesting_origin, service_worker_registration_id);
if (app_identifier.is_null()) {
if (!callback.is_null()) {
callback.Run(
@@ -491,7 +492,7 @@ void PushMessagingServiceImpl::Unregister(
// TODO(johnme): Instead of deleting these app ids, store them elsewhere, and
// retry unregistration if it fails due to network errors (crbug.com/465399).
PushMessagingAppIdentifier app_identifier =
- PushMessagingAppIdentifier::Get(profile_, app_id);
+ PushMessagingAppIdentifier::FindByAppId(profile_, app_id);
bool was_registered = !app_identifier.is_null();
if (was_registered)
app_identifier.DeleteFromPrefs(profile_);
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698