| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 REMOTING_BASE_URL_REQUEST_H_ | 5 #ifndef REMOTING_BASE_URL_REQUEST_H_ |
| 6 #define REMOTING_BASE_URL_REQUEST_H_ | 6 #define REMOTING_BASE_URL_REQUEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "net/traffic_annotation/network_traffic_annotation.h" |
| 12 | 13 |
| 13 namespace remoting { | 14 namespace remoting { |
| 14 | 15 |
| 15 // Abstract interface for URL requests. | 16 // Abstract interface for URL requests. |
| 16 class UrlRequest { | 17 class UrlRequest { |
| 17 public: | 18 public: |
| 18 enum class Type { | 19 enum class Type { |
| 19 GET, | 20 GET, |
| 20 POST, | 21 POST, |
| 21 }; | 22 }; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // return result of the request. | 55 // return result of the request. |
| 55 virtual void Start(const OnResultCallback& on_result_callback) = 0; | 56 virtual void Start(const OnResultCallback& on_result_callback) = 0; |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 // Factory for UrlRequest instances. | 59 // Factory for UrlRequest instances. |
| 59 class UrlRequestFactory { | 60 class UrlRequestFactory { |
| 60 public: | 61 public: |
| 61 virtual ~UrlRequestFactory() {} | 62 virtual ~UrlRequestFactory() {} |
| 62 virtual std::unique_ptr<UrlRequest> CreateUrlRequest( | 63 virtual std::unique_ptr<UrlRequest> CreateUrlRequest( |
| 63 UrlRequest::Type type, | 64 UrlRequest::Type type, |
| 64 const std::string& url) = 0; | 65 const std::string& url, |
| 66 const net::NetworkTrafficAnnotationTag& traffic_annotation) = 0; |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace remoting | 69 } // namespace remoting |
| 68 | 70 |
| 69 #endif // REMOTING_BASE_URL_REQUEST_H_ | 71 #endif // REMOTING_BASE_URL_REQUEST_H_ |
| OLD | NEW |