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

Side by Side 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: Fix app id lifetime, and simplify usage 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 unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ 5 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ 6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "components/content_settings/core/browser/content_settings_observer.h" 10 #include "components/content_settings/core/browser/content_settings_observer.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // content_settings::Observer implementation. 82 // content_settings::Observer implementation.
83 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, 83 void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern,
84 const ContentSettingsPattern& secondary_pattern, 84 const ContentSettingsPattern& secondary_pattern,
85 ContentSettingsType content_type, 85 ContentSettingsType content_type,
86 std::string resource_identifier) override; 86 std::string resource_identifier) override;
87 87
88 // KeyedService implementation. 88 // KeyedService implementation.
89 void Shutdown() override; 89 void Shutdown() override;
90 90
91 private: 91 private:
92 friend class PushMessagingBrowserTest;
92 // A registration is pending until it has succeeded or failed. 93 // A registration is pending until it has succeeded or failed.
93 void IncreasePushRegistrationCount(int add, bool is_pending); 94 void IncreasePushRegistrationCount(int add, bool is_pending);
94 void DecreasePushRegistrationCount(int subtract, bool was_pending); 95 void DecreasePushRegistrationCount(int subtract, bool was_pending);
95 96
96 // OnMessage methods --------------------------------------------------------- 97 // OnMessage methods ---------------------------------------------------------
97 98
98 void DeliverMessageCallback(const std::string& app_id_guid, 99 void DeliverMessageCallback(const std::string& app_id_guid,
99 const GURL& requesting_origin, 100 const GURL& requesting_origin,
100 int64 service_worker_registration_id, 101 int64 service_worker_registration_id,
101 const gcm::GCMClient::IncomingMessage& message, 102 const gcm::GCMClient::IncomingMessage& message,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 165
165 int push_registration_count_; 166 int push_registration_count_;
166 int pending_push_registration_count_; 167 int pending_push_registration_count_;
167 168
168 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; 169 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_;
169 170
170 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); 171 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl);
171 }; 172 };
172 173
173 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ 174 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698