| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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_APPCACHE_APPCACHE_REQUEST_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/sequence_checker.h" |
| 9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 10 #include "base/threading/non_thread_safe.h" | |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 class URLRequest; | 15 class URLRequest; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 struct ResourceRequest; | 19 struct ResourceRequest; |
| 20 | 20 |
| 21 // Interface for an AppCache request. Subclasses implement this interface to | 21 // Interface for an AppCache request. Subclasses implement this interface to |
| 22 // wrap custom request objects like URLRequest, etc to ensure that these | 22 // wrap custom request objects like URLRequest, etc to ensure that these |
| 23 // dependencies stay out of the AppCache code. | 23 // dependencies stay out of the AppCache code. |
| 24 class CONTENT_EXPORT AppCacheRequest | 24 class CONTENT_EXPORT AppCacheRequest { |
| 25 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
| 26 public: | 25 public: |
| 27 virtual ~AppCacheRequest() {} | 26 virtual ~AppCacheRequest(); |
| 28 | 27 |
| 29 // The URL for this request. | 28 // The URL for this request. |
| 30 virtual const GURL& GetURL() const = 0; | 29 virtual const GURL& GetURL() const = 0; |
| 31 | 30 |
| 32 // The method for this request | 31 // The method for this request |
| 33 virtual const std::string& GetMethod() const = 0; | 32 virtual const std::string& GetMethod() const = 0; |
| 34 | 33 |
| 35 // Used for cookie policy. | 34 // Used for cookie policy. |
| 36 virtual const GURL& GetFirstPartyForCookies() const = 0; | 35 virtual const GURL& GetFirstPartyForCookies() const = 0; |
| 37 | 36 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 66 | 65 |
| 67 AppCacheRequest() {} | 66 AppCacheRequest() {} |
| 68 | 67 |
| 69 // Getters for the request types we currently support. | 68 // Getters for the request types we currently support. |
| 70 virtual net::URLRequest* GetURLRequest(); | 69 virtual net::URLRequest* GetURLRequest(); |
| 71 | 70 |
| 72 // Returns the underlying ResourceRequest. Please note that only one of | 71 // Returns the underlying ResourceRequest. Please note that only one of |
| 73 // GetURLRequest() and GetResourceRequest() should return valid results. | 72 // GetURLRequest() and GetResourceRequest() should return valid results. |
| 74 virtual ResourceRequest* GetResourceRequest(); | 73 virtual ResourceRequest* GetResourceRequest(); |
| 75 | 74 |
| 75 SEQUENCE_CHECKER(sequence_checker_); |
| 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(AppCacheRequest); | 77 DISALLOW_COPY_AND_ASSIGN(AppCacheRequest); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace content | 80 } // namespace content |
| 80 | 81 |
| 81 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_H_ | 82 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_H_ |
| OLD | NEW |