| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | 5 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
| 10 #include "base/base64url.h" | 10 #include "base/base64url.h" |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 // GetEncryptionInfo methods --------------------------------------------------- | 567 // GetEncryptionInfo methods --------------------------------------------------- |
| 568 | 568 |
| 569 void PushMessagingServiceImpl::GetEncryptionInfo( | 569 void PushMessagingServiceImpl::GetEncryptionInfo( |
| 570 const GURL& origin, | 570 const GURL& origin, |
| 571 int64_t service_worker_registration_id, | 571 int64_t service_worker_registration_id, |
| 572 const PushMessagingService::EncryptionInfoCallback& callback) { | 572 const PushMessagingService::EncryptionInfoCallback& callback) { |
| 573 PushMessagingAppIdentifier app_identifier = | 573 PushMessagingAppIdentifier app_identifier = |
| 574 PushMessagingAppIdentifier::FindByServiceWorker( | 574 PushMessagingAppIdentifier::FindByServiceWorker( |
| 575 profile_, origin, service_worker_registration_id); | 575 profile_, origin, service_worker_registration_id); |
| 576 | 576 |
| 577 DCHECK(!app_identifier.is_null()); | 577 // DCHECK(!app_identifier.is_null()); |
| 578 | 578 if (app_identifier.is_null()) |
| 579 return; |
| 579 GetGCMDriver()->GetEncryptionInfo( | 580 GetGCMDriver()->GetEncryptionInfo( |
| 580 app_identifier.app_id(), | 581 app_identifier.app_id(), |
| 581 base::Bind(&PushMessagingServiceImpl::DidGetEncryptionInfo, | 582 base::Bind(&PushMessagingServiceImpl::DidGetEncryptionInfo, |
| 582 weak_factory_.GetWeakPtr(), callback)); | 583 weak_factory_.GetWeakPtr(), callback)); |
| 583 } | 584 } |
| 584 | 585 |
| 585 void PushMessagingServiceImpl::DidGetEncryptionInfo( | 586 void PushMessagingServiceImpl::DidGetEncryptionInfo( |
| 586 const PushMessagingService::EncryptionInfoCallback& callback, | 587 const PushMessagingService::EncryptionInfoCallback& callback, |
| 587 const std::string& p256dh, | 588 const std::string& p256dh, |
| 588 const std::string& auth_secret) const { | 589 const std::string& auth_secret) const { |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 blink::WebPushPermissionStatusGranted; | 800 blink::WebPushPermissionStatusGranted; |
| 800 } | 801 } |
| 801 | 802 |
| 802 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { | 803 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { |
| 803 gcm::GCMProfileService* gcm_profile_service = | 804 gcm::GCMProfileService* gcm_profile_service = |
| 804 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 805 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
| 805 CHECK(gcm_profile_service); | 806 CHECK(gcm_profile_service); |
| 806 CHECK(gcm_profile_service->driver()); | 807 CHECK(gcm_profile_service->driver()); |
| 807 return gcm_profile_service->driver(); | 808 return gcm_profile_service->driver(); |
| 808 } | 809 } |
| OLD | NEW |