Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVER_URL_BUILDER_H_ | |
| 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVER_URL_BUILDER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "sync/api/attachments/attachment_id.h" | |
| 11 #include "sync/base/sync_export.h" | |
| 12 #include "url/gurl.h" | |
| 13 | |
| 14 namespace syncer { | |
| 15 | |
| 16 // Used to obtain the upload URL for an attachment. | |
| 17 class SYNC_EXPORT AttachmentServerURLBuilder { | |
| 18 public: | |
| 19 enum Scheme { | |
| 20 SCHEME_HTTPS, | |
| 21 SCHEME_HTTP, | |
| 22 }; | |
| 23 | |
| 24 // Construct an AttachmentServerURLBuilder that builds URLs with the specified | |
| 25 // |scheme|, |host|, and |port|. | |
| 26 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
| |
| 27 const std::string& host, | |
| 28 const int port); | |
| 29 | |
| 30 ~AttachmentServerURLBuilder(); | |
| 31 | |
| 32 // Default copy and assign welcome. | |
| 33 | |
| 34 // Return a URL to which the attachment identified by |attachment_id| can be | |
| 35 // uploaded. | |
| 36 GURL BuildUploadURLFor(const AttachmentId& attachment_id) const; | |
| 37 | |
| 38 private: | |
| 39 std::string url_prefix_; | |
| 40 }; | |
| 41 | |
| 42 } // namespace syncer | |
| 43 | |
| 44 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVER_URL_BUILDER_H_ | |
| OLD | NEW |