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

Side by Side Diff: content/browser/background_sync/background_sync_manager.h

Issue 1294603003: [BackgroundSync] Trigger Background Sync events when Chrome is backgrounded on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update browser tests to trigger network observer directly Created 5 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_
6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 void GetRegistrations(int64 sw_registration_id, 94 void GetRegistrations(int64 sw_registration_id,
95 SyncPeriodicity periodicity, 95 SyncPeriodicity periodicity,
96 const StatusAndRegistrationsCallback& callback); 96 const StatusAndRegistrationsCallback& callback);
97 97
98 // ServiceWorkerContextObserver overrides. 98 // ServiceWorkerContextObserver overrides.
99 void OnRegistrationDeleted(int64 registration_id, 99 void OnRegistrationDeleted(int64 registration_id,
100 const GURL& pattern) override; 100 const GURL& pattern) override;
101 void OnStorageWiped() override; 101 void OnStorageWiped() override;
102 102
103 BackgroundSyncNetworkObserver* GetNetworkObserverForTesting() {
104 return network_observer_.get();
105 }
106
103 protected: 107 protected:
104 explicit BackgroundSyncManager( 108 explicit BackgroundSyncManager(
105 const scoped_refptr<ServiceWorkerContextWrapper>& context); 109 const scoped_refptr<ServiceWorkerContextWrapper>& context);
106 110
107 // Init must be called before any public member function. Only call it once. 111 // Init must be called before any public member function. Only call it once.
108 void Init(); 112 void Init();
109 113
110 // The following methods are virtual for testing. 114 // The following methods are virtual for testing.
111 virtual void StoreDataInBackend( 115 virtual void StoreDataInBackend(
112 int64 sw_registration_id, 116 int64 sw_registration_id,
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 scoped_ptr<BackgroundSyncPowerObserver> power_observer_; 306 scoped_ptr<BackgroundSyncPowerObserver> power_observer_;
303 307
304 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; 308 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_;
305 309
306 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); 310 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager);
307 }; 311 };
308 312
309 } // namespace content 313 } // namespace content
310 314
311 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ 315 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698