OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 SYNC_INTERNAL_API_PUBLIC_HTTP_POST_PROVIDER_INTERFACE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_HTTP_POST_PROVIDER_INTERFACE_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_HTTP_POST_PROVIDER_INTERFACE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_HTTP_POST_PROVIDER_INTERFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "sync/base/sync_export.h" |
| 11 |
10 namespace syncer { | 12 namespace syncer { |
11 | 13 |
12 // An interface the embedding application (e.g. Chromium) implements to provide | 14 // An interface the embedding application (e.g. Chromium) implements to provide |
13 // required HTTP POST functionality to the syncer backend. This interface is | 15 // required HTTP POST functionality to the syncer backend. This interface is |
14 // designed for one-time use. You create one, use it, and create another if you | 16 // designed for one-time use. You create one, use it, and create another if you |
15 // want to make a subsequent POST. | 17 // want to make a subsequent POST. |
16 class HttpPostProviderInterface { | 18 class SYNC_EXPORT_PRIVATE HttpPostProviderInterface { |
17 public: | 19 public: |
18 // Add additional headers to the request. | 20 // Add additional headers to the request. |
19 virtual void SetExtraRequestHeaders(const char* headers) = 0; | 21 virtual void SetExtraRequestHeaders(const char* headers) = 0; |
20 | 22 |
21 // Set the URL to POST to. | 23 // Set the URL to POST to. |
22 virtual void SetURL(const char* url, int port) = 0; | 24 virtual void SetURL(const char* url, int port) = 0; |
23 | 25 |
24 // Set the type, length and content of the POST payload. | 26 // Set the type, length and content of the POST payload. |
25 // |content_type| is a null-terminated MIME type specifier. | 27 // |content_type| is a null-terminated MIME type specifier. |
26 // |content| is a data buffer; Do not interpret as a null-terminated string. | 28 // |content| is a data buffer; Do not interpret as a null-terminated string. |
(...skipping 26 matching lines...) Expand all Loading... |
53 // This must be safe to call from any thread. | 55 // This must be safe to call from any thread. |
54 virtual void Abort() = 0; | 56 virtual void Abort() = 0; |
55 | 57 |
56 protected: | 58 protected: |
57 virtual ~HttpPostProviderInterface() {} | 59 virtual ~HttpPostProviderInterface() {} |
58 }; | 60 }; |
59 | 61 |
60 } // namespace syncer | 62 } // namespace syncer |
61 | 63 |
62 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_POST_PROVIDER_INTERFACE_H_ | 64 #endif // SYNC_INTERNAL_API_PUBLIC_HTTP_POST_PROVIDER_INTERFACE_H_ |
OLD | NEW |