Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: sync/internal_api/public/attachments/attachment_uploader_impl.h

Issue 278263003: Add a minimal AttachmentUploaderImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up after self-review. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_UPLOADER_IMPL_H_
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_
7
8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/threading/non_thread_safe.h"
10 #include "net/url_request/url_request_context_getter.h"
11 #include "sync/api/attachments/attachment_uploader.h"
12 #include "sync/internal_api/public/attachments/attachment_server_url_builder.h"
13
14 namespace net {
15 class URLRequestContextGetter;
16 } // namespace net
17
18 namespace syncer {
19
20 // An implementation of AttachmentUploader.
21 class SYNC_EXPORT AttachmentUploaderImpl : public AttachmentUploader,
22 public base::NonThreadSafe {
23 public:
24 AttachmentUploaderImpl(const AttachmentServerURLBuilder& url_builder,
25 const scoped_refptr<net::URLRequestContextGetter>&
26 url_request_context_getter);
27 virtual ~AttachmentUploaderImpl();
28
29 // AttachmentUploader implementation.
30 virtual void UploadAttachment(const Attachment& attachment,
31 const UploadCallback& callback) OVERRIDE;
32
33 private:
34 class UploadState;
35 typedef std::string UniqueId;
36 typedef base::ScopedPtrHashMap<UniqueId, UploadState> StateMap;
37
38 AttachmentServerURLBuilder url_builder_;
39 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
40 StateMap state_map_;
41 DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl);
42 };
43
44 } // namespace syncer
45
46 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698