Index: sync/internal_api/public/attachments/attachment_server_url_builder.h |
diff --git a/sync/internal_api/public/attachments/attachment_server_url_builder.h b/sync/internal_api/public/attachments/attachment_server_url_builder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..543d41ee562355c13ad1288be214c271426a2936 |
--- /dev/null |
+++ b/sync/internal_api/public/attachments/attachment_server_url_builder.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2014 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 SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVER_URL_BUILDER_H_ |
+#define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVER_URL_BUILDER_H_ |
+ |
+#include <string> |
+ |
+#include "sync/api/attachments/attachment_id.h" |
+#include "sync/base/sync_export.h" |
+#include "url/gurl.h" |
+ |
+namespace syncer { |
+ |
+// Used to obtain the upload URL for an attachment. |
+class SYNC_EXPORT AttachmentServerURLBuilder { |
+ public: |
+ enum Scheme { |
+ SCHEME_HTTPS, |
+ SCHEME_HTTP, |
+ }; |
+ |
+ // Construct an AttachmentServerURLBuilder that builds URLs with the specified |
+ // |scheme|, |host|, and |port|. |
+ AttachmentServerURLBuilder(const Scheme& scheme, |
pavely
2014/05/14 18:38:31
Do you have a scenario where you'll need to pass a
maniscalco
2014/05/14 21:59:03
We could get away with using a string as a URL pre
|
+ const std::string& host, |
+ const int port); |
+ |
+ ~AttachmentServerURLBuilder(); |
+ |
+ // Default copy and assign welcome. |
+ |
+ // Return a URL to which the attachment identified by |attachment_id| can be |
+ // uploaded. |
+ GURL BuildUploadURLFor(const AttachmentId& attachment_id) const; |
+ |
+ private: |
+ std::string url_prefix_; |
+}; |
+ |
+} // namespace syncer |
+ |
+#endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVER_URL_BUILDER_H_ |