OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_FETCH_REQUEST_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_FETCH_REQUEST_H_ |
| 7 |
| 8 #include "content/common/content_export.h" |
| 9 #include "content/common/service_worker/service_worker_types.h" |
| 10 #include "url/gurl.h" |
| 11 #include "url/origin.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // Simple class to encapsulate the components of a fetch request. |
| 16 class CONTENT_EXPORT FetchRequest { |
| 17 public: |
| 18 FetchRequest(); |
| 19 FetchRequest(const url::Origin& origin, |
| 20 const GURL& url, |
| 21 int64_t sw_registration_id, |
| 22 const std::string& tag); |
| 23 // TODO(harkness): Remove copy constructor once the final (non-map-based) |
| 24 // state management is in place. |
| 25 FetchRequest(const FetchRequest& request); |
| 26 ~FetchRequest(); |
| 27 |
| 28 const std::string& guid() const { return guid_; } |
| 29 const url::Origin& origin() const { return origin_; } |
| 30 const GURL& url() const { return url_; } |
| 31 int64_t service_worker_registration_id() const { |
| 32 return service_worker_registration_id_; |
| 33 } |
| 34 const std::string& tag() const { return tag_; } |
| 35 |
| 36 private: |
| 37 std::string guid_; |
| 38 url::Origin origin_; |
| 39 GURL url_; |
| 40 int64_t service_worker_registration_id_ = kInvalidServiceWorkerRegistrationId; |
| 41 std::string tag_; |
| 42 }; |
| 43 |
| 44 } // namespace content |
| 45 |
| 46 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_FETCH_REQUEST_H_ |
OLD | NEW |