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

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

Issue 996813002: Deflake PushMessagingBrowserTest.DenyPushPermissionUnregisters & friends (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use scoped_refptr Created 5 years, 9 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
Index: chrome/browser/push_messaging/push_messaging_service_impl.h
diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.h b/chrome/browser/push_messaging/push_messaging_service_impl.h
index e6963d40008cf4115c82dfc08c162ba570ffabf7..a08d16fb0014883af60e100063d92ecc7b5d5eb6 100644
--- a/chrome/browser/push_messaging/push_messaging_service_impl.h
+++ b/chrome/browser/push_messaging/push_messaging_service_impl.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
#define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "components/content_settings/core/browser/content_settings_observer.h"
@@ -87,6 +88,9 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
// KeyedService implementation.
void Shutdown() override;
+ void SetContentSettingChangedCallbackForTesting(
+ const base::Closure& callback);
+
private:
// A registration is pending until it has succeeded or failed.
void IncreasePushRegistrationCount(int add, bool is_pending);
@@ -147,6 +151,7 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
// OnContentSettingChanged methods -------------------------------------------
void UnregisterBecausePermissionRevoked(const PushMessagingApplicationId& id,
+ const base::Closure& closure,
const std::string& sender_id,
bool success, bool not_found);
@@ -162,6 +167,8 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
int push_registration_count_;
int pending_push_registration_count_;
+ base::Closure content_setting_changed_callback_for_testing_;
+
base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl);

Powered by Google App Engine
This is Rietveld 408576698