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

Unified Diff: sync/test/fake_server/fake_server.h

Issue 1866243002: Convert //sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: sync/test/fake_server/fake_server.h
diff --git a/sync/test/fake_server/fake_server.h b/sync/test/fake_server/fake_server.h
index 0f6e321ebb3228e4a001f7310b2f6276fab344c0..03b3c324c006bcb21c71573b9c663b7a5145026a 100644
--- a/sync/test/fake_server/fake_server.h
+++ b/sync/test/fake_server/fake_server.h
@@ -8,11 +8,11 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <string>
#include <vector>
#include "base/callback.h"
-#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/threading/thread_checker.h"
#include "base/values.h"
@@ -61,7 +61,7 @@ class FakeServer {
// server. The dictionary keys are the strings generated by ModelTypeToString
// and the values are ListValues containing StringValue versions of entity
// names.
- scoped_ptr<base::DictionaryValue> GetEntitiesAsDictionaryValue();
+ std::unique_ptr<base::DictionaryValue> GetEntitiesAsDictionaryValue();
// Returns all entities stored by the server of the given |model_type|.
// This method returns SyncEntity protocol buffer objects (instead of
@@ -73,7 +73,7 @@ class FakeServer {
// Adds |entity| to the server's collection of entities. This method makes no
// guarantees that the added entity will result in successful server
// operations.
- void InjectEntity(scoped_ptr<FakeServerEntity> entity);
+ void InjectEntity(std::unique_ptr<FakeServerEntity> entity);
// Modifies the entity on the server with the given |id|. The entity's
// EntitySpecifics are replaced with |updated_specifics| and its version is
@@ -149,7 +149,7 @@ class FakeServer {
base::WeakPtr<FakeServer> AsWeakPtr();
private:
- using EntityMap = std::map<std::string, scoped_ptr<FakeServerEntity>>;
+ using EntityMap = std::map<std::string, std::unique_ptr<FakeServerEntity>>;
// Gets FakeServer ready for syncing.
void Init();
@@ -171,7 +171,7 @@ class FakeServer {
bool CreateDefaultPermanentItems();
// Saves a |entity| to |entities_|.
- void SaveEntity(scoped_ptr<FakeServerEntity> entity);
+ void SaveEntity(std::unique_ptr<FakeServerEntity> entity);
// Commits a client-side SyncEntity to the server as a FakeServerEntity.
// The client that sent the commit is identified via |client_guid|. The
@@ -233,7 +233,8 @@ class FakeServer {
// Used as the error field of ClientToServerResponse when its pointer is not
// NULL.
- scoped_ptr<sync_pb::ClientToServerResponse_Error> triggered_actionable_error_;
+ std::unique_ptr<sync_pb::ClientToServerResponse_Error>
+ triggered_actionable_error_;
// These values are used in tandem to return a triggered error (either
// |error_type_| or |triggered_actionable_error_|) on every other request.

Powered by Google App Engine
This is Rietveld 408576698