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

Unified Diff: content/browser/background_fetch/background_fetch_context.h

Issue 2777183002: Hook up the other Background Fetch Mojo methods with the system (Closed)
Patch Set: Hook up the other Background Fetch Mojo methods with the system Created 3 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
« no previous file with comments | « no previous file | content/browser/background_fetch/background_fetch_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/background_fetch/background_fetch_context.h
diff --git a/content/browser/background_fetch/background_fetch_context.h b/content/browser/background_fetch/background_fetch_context.h
index 41c9e7fd739a5f00c4b8e7e99f540f94458749ea..b1e5924fe988b331ef57e671d902d1b708d10bc5 100644
--- a/content/browser/background_fetch/background_fetch_context.h
+++ b/content/browser/background_fetch/background_fetch_context.h
@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_CONTEXT_H_
#include <map>
+#include <string>
#include <vector>
#include "base/macros.h"
@@ -14,6 +15,10 @@
#include "content/public/browser/browser_thread.h"
#include "third_party/WebKit/public/platform/modules/background_fetch/background_fetch.mojom.h"
+namespace url {
+class Origin;
+}
+
namespace content {
class BackgroundFetchDataManager;
@@ -52,6 +57,17 @@ class CONTENT_EXPORT BackgroundFetchContext
const BackgroundFetchOptions& options,
const blink::mojom::BackgroundFetchService::FetchCallback& callback);
+ // Returns a vector with the tags of the active fetches for the given |origin|
+ // and |service_worker_registration_id|.
+ std::vector<std::string> GetActiveTagsForServiceWorkerRegistration(
+ int64_t service_worker_registration_id,
+ const url::Origin& origin) const;
+
+ // Returns the JobController that is handling the |registration_id|, or a
+ // nullptr if it does not exist. Must be immediately used by the caller.
+ BackgroundFetchJobController* GetActiveFetch(
+ const BackgroundFetchRegistrationId& registration_id) const;
+
private:
friend class base::DeleteHelper<BackgroundFetchContext>;
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
@@ -76,8 +92,10 @@ class CONTENT_EXPORT BackgroundFetchContext
blink::mojom::BackgroundFetchError error);
// Called when a Job Controller has finished processing a Background Fetch
- // registration, as identified by |registration_id|.
- void DidFinishFetch(const BackgroundFetchRegistrationId& registration_id);
+ // registration, as identified by |registration_id|. |aborted_by_developer|
+ // will be set to true when it finished at the developer's request.
+ void DidFinishFetch(const BackgroundFetchRegistrationId& registration_id,
+ bool aborted_by_developer);
// |this| is owned by the BrowserContext via the StoragePartitionImpl.
BrowserContext* browser_context_;
« no previous file with comments | « no previous file | content/browser/background_fetch/background_fetch_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698