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

Unified Diff: chrome/browser/background_fetch/background_fetch_client_impl.h

Issue 2833793002: Added AddDownload communication path and observers
Patch Set: Addressed comments and moved thrad jumps into the client proxy. Created 3 years, 8 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/background_fetch/background_fetch_client_impl.h
diff --git a/chrome/browser/background_fetch/background_fetch_client_impl.h b/chrome/browser/background_fetch/background_fetch_client_impl.h
index c812d126ba2fc11d3a13be3b2b25f00b8d371424..b7915be9c6f8c6d01acf647607de24251402abf6 100644
--- a/chrome/browser/background_fetch/background_fetch_client_impl.h
+++ b/chrome/browser/background_fetch/background_fetch_client_impl.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/macros.h"
+#include "base/observer_list.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/offline_items_collection/core/offline_content_provider.h"
#include "content/public/browser/background_fetch_client.h"
@@ -32,6 +33,10 @@ class BackgroundFetchClientImpl
// content::BackgroundFetchClient implementation.
void SetDelegate(content::BackgroundFetchClient::Delegate* delegate) override;
+ void AddDownload(const GURL& url,
+ const std::string& registration_id,
+ const std::string& title,
+ int64_t total_download_size) override;
// components::offline_items_collection::OfflineContentProvider overrides.
bool AreItemsAvailable() override;
@@ -59,11 +64,14 @@ class BackgroundFetchClientImpl
// The |delegate| is owned externally and will remove itself prior to
// deletion.
- content::BackgroundFetchClient::Delegate* delegate_;
+ content::BackgroundFetchClient::Delegate* delegate_ = nullptr;
Peter Beverloo 2017/04/24 14:39:15 Should probably merge this in the previous CL.
// The name of the namespace registered with the aggregator.
std::string namespace_;
+ // A list of all currently registered observers.
+ base::ObserverList<OfflineContentProvider::Observer> observers_;
+
DISALLOW_COPY_AND_ASSIGN(BackgroundFetchClientImpl);
};

Powered by Google App Engine
This is Rietveld 408576698