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

Side by Side Diff: sync/api/attachments/attachment_store.h

Issue 751313005: Add the Sync.Attachments.StoreInitResult histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add explicit enum values and increase the SIZE constant to 10. Created 6 years 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
« no previous file with comments | « no previous file | sync/internal_api/attachments/on_disk_attachment_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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_API_ATTACHMENTS_ATTACHMENT_STORE_H_ 5 #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_
6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 15 matching lines...) Expand all
26 26
27 // A place to locally store and access Attachments. 27 // A place to locally store and access Attachments.
28 // 28 //
29 // Destroying this object does not necessarily cancel outstanding async 29 // Destroying this object does not necessarily cancel outstanding async
30 // operations. If you need cancel like semantics, use WeakPtr in the callbacks. 30 // operations. If you need cancel like semantics, use WeakPtr in the callbacks.
31 class SYNC_EXPORT AttachmentStoreBase { 31 class SYNC_EXPORT AttachmentStoreBase {
32 public: 32 public:
33 // TODO(maniscalco): Consider udpating Read and Write methods to support 33 // TODO(maniscalco): Consider udpating Read and Write methods to support
34 // resumable transfers (bug 353292). 34 // resumable transfers (bug 353292).
35 35
36 // The result status of an attachment store operation.
37 // Do not re-order or delete these entries; they are used in a UMA histogram.
36 enum Result { 38 enum Result {
37 SUCCESS, // No error, all completed successfully. 39 SUCCESS = 0, // No error, all completed successfully.
38 UNSPECIFIED_ERROR, // An unspecified error occurred for one or more items. 40 UNSPECIFIED_ERROR = 1, // An unspecified error occurred for >= 1 item.
39 STORE_INITIALIZATION_FAILED, // AttachmentStore initialization failed. 41 STORE_INITIALIZATION_FAILED = 2, // AttachmentStore initialization failed.
42 // When adding a value here, you must increment RESULT_SIZE below.
40 }; 43 };
44 const int RESULT_SIZE = 10; // Size of the Result enum; used for histograms.
41 45
42 typedef base::Callback<void(const Result&)> InitCallback; 46 typedef base::Callback<void(const Result&)> InitCallback;
43 typedef base::Callback<void(const Result&, 47 typedef base::Callback<void(const Result&,
44 scoped_ptr<AttachmentMap>, 48 scoped_ptr<AttachmentMap>,
45 scoped_ptr<AttachmentIdList>)> ReadCallback; 49 scoped_ptr<AttachmentIdList>)> ReadCallback;
46 typedef base::Callback<void(const Result&)> WriteCallback; 50 typedef base::Callback<void(const Result&)> WriteCallback;
47 typedef base::Callback<void(const Result&)> DropCallback; 51 typedef base::Callback<void(const Result&)> DropCallback;
48 typedef base::Callback<void(const Result&, 52 typedef base::Callback<void(const Result&,
49 scoped_ptr<AttachmentMetadataList>)> 53 scoped_ptr<AttachmentMetadataList>)>
50 ReadMetadataCallback; 54 ReadMetadataCallback;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 const InitCallback& callback); 144 const InitCallback& callback);
141 145
142 protected: 146 protected:
143 friend class base::RefCountedThreadSafe<AttachmentStore>; 147 friend class base::RefCountedThreadSafe<AttachmentStore>;
144 ~AttachmentStore() override; 148 ~AttachmentStore() override;
145 }; 149 };
146 150
147 } // namespace syncer 151 } // namespace syncer
148 152
149 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_ 153 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | sync/internal_api/attachments/on_disk_attachment_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698