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

Unified Diff: sync/api/attachments/attachment.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/api/attachments/README ('k') | sync/api/attachments/attachment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/attachments/attachment.h
diff --git a/sync/api/attachments/attachment.h b/sync/api/attachments/attachment.h
deleted file mode 100644
index b05534bbc682032193ad93f6bbc271195e1c9296..0000000000000000000000000000000000000000
--- a/sync/api/attachments/attachment.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// 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_API_ATTACHMENTS_ATTACHMENT_H_
-#define SYNC_API_ATTACHMENTS_ATTACHMENT_H_
-
-#include <stdint.h>
-
-#include <map>
-#include <memory>
-#include <vector>
-
-#include "base/memory/ref_counted.h"
-#include "base/memory/ref_counted_memory.h"
-#include "sync/api/attachments/attachment_id.h"
-#include "sync/base/sync_export.h"
-
-namespace syncer {
-
-// A blob of in-memory data attached to a sync item.
-//
-// While Attachment objects themselves aren't immutable (they are assignable)
-// the data they wrap is immutable.
-//
-// It is cheap to copy Attachments. Feel free to store and return by value.
-class SYNC_EXPORT Attachment {
- public:
- Attachment(const Attachment& other);
- ~Attachment();
-
- // Default copy and assignment are welcome.
-
- // Creates an attachment with a unique id and the supplied data.
- //
- // Used when creating a brand new attachment.
- static Attachment Create(const scoped_refptr<base::RefCountedMemory>& data);
-
- // Creates an attachment with the supplied id and data.
- //
- // Used when you want to recreate a specific attachment. E.g. creating a local
- // copy of an attachment that already exists on the sync server.
- static Attachment CreateFromParts(
- const AttachmentId& id,
- const scoped_refptr<base::RefCountedMemory>& data);
-
- // Returns this attachment's id.
- const AttachmentId& GetId() const;
-
- // Returns this attachment's data.
- const scoped_refptr<base::RefCountedMemory>& GetData() const;
-
- // Returns precomputed crc32c hash of data. In ideal case this hash is
- // computed when attachment is first created. It is then passed around through
- // local attachment store and attachment server. Crc is verified when
- // attachment is downloaded from server or loaded from local storage.
- uint32_t GetCrc32c() const;
-
- private:
- AttachmentId id_;
- scoped_refptr<base::RefCountedMemory> data_;
-
- Attachment(const AttachmentId& id,
- const scoped_refptr<base::RefCountedMemory>& data);
-};
-
-typedef std::vector<syncer::Attachment> AttachmentList;
-typedef std::map<AttachmentId, Attachment> AttachmentMap;
-
-} // namespace syncer
-
-#endif // SYNC_API_ATTACHMENTS_ATTACHMENT_H_
« no previous file with comments | « sync/api/attachments/README ('k') | sync/api/attachments/attachment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698