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

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

Issue 2678273003: Initial framework setup and skeleton for BackgroundFetchContext (Closed)
Patch Set: Remove BackgroundFetchDownloadObserver until it's used. Created 3 years, 10 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: content/browser/background_fetch/fetch_request.h
diff --git a/content/browser/background_fetch/fetch_request.h b/content/browser/background_fetch/fetch_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..17ab4b0b3bdadda7fe5fd3a128d6a0f8394fe807
--- /dev/null
+++ b/content/browser/background_fetch/fetch_request.h
@@ -0,0 +1,42 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_FETCH_REQUEST_H_
+#define CONTENT_BROWSER_BACKGROUND_FETCH_FETCH_REQUEST_H_
+
Peter Beverloo 2017/02/13 18:35:06 nit: <string>
harkness 2017/02/14 13:52:47 Done.
+#include "content/common/content_export.h"
+#include "url/origin.h"
+
+namespace content {
+
+class DownloadItem;
+
+// Simple class to encapsulate the components of a fetch request.
+class CONTENT_EXPORT FetchRequest {
Peter Beverloo 2017/02/13 18:35:06 We're really going to have to think about this cla
harkness 2017/02/14 13:52:47 Yes, how that registration is divided between the
+ public:
+ FetchRequest();
+ FetchRequest(const url::Origin& origin,
+ const url::Origin& url,
Peter Beverloo 2017/02/13 18:35:06 Why is |url| a url::Origin? At the very least it n
harkness 2017/02/14 13:52:47 Good point.
+ const std::string& tag,
+ DownloadItem* download_item);
+ FetchRequest(const FetchRequest& request);
Peter Beverloo 2017/02/13 18:35:06 q: where would we copy instances of this object?
harkness 2017/02/14 13:52:47 map uses it
Peter Beverloo 2017/02/14 15:05:52 Let's add a TODO to get rid of it since the map is
+ ~FetchRequest();
+
+ const std::string& guid() const { return guid_; }
+ const url::Origin& origin() const { return origin_; }
+ const url::Origin& url() const { return url_; }
+ const std::string& tag() const { return tag_; }
+ const DownloadItem* download_item() const { return download_item_; }
+
+ private:
+ std::string guid_;
+ url::Origin origin_;
+ url::Origin url_;
+ std::string tag_;
+ DownloadItem* download_item_;
Peter Beverloo 2017/02/13 18:35:06 nit: document what the ownership model is
harkness 2017/02/14 13:52:46 I removed this, since I don't need DownloadItems u
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_BACKGROUND_FETCH_FETCH_REQUEST_H_

Powered by Google App Engine
This is Rietveld 408576698