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

Unified Diff: components/sync/engine/events/protocol_event.cc

Issue 2898723003: [Sync] Migrate SyncInternalsMessageHandler off CallJavascriptFunctionUnsafe. (Closed)
Patch Set: More updates for dbeam. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/engine/events/protocol_event.cc
diff --git a/components/sync/engine/events/protocol_event.cc b/components/sync/engine/events/protocol_event.cc
index 3f7f813eb7b6bb76438bd480b72316cf64277ef1..629b2bbf3f31b6b48bd54ef92f3979bfc7ec3a77 100644
--- a/components/sync/engine/events/protocol_event.cc
+++ b/components/sync/engine/events/protocol_event.cc
@@ -4,6 +4,10 @@
#include "components/sync/engine/events/protocol_event.h"
+#include <utility>
+
+#include "base/memory/ptr_util.h"
+
namespace syncer {
ProtocolEvent::ProtocolEvent() {}
@@ -12,13 +16,11 @@ ProtocolEvent::~ProtocolEvent() {}
std::unique_ptr<base::DictionaryValue> ProtocolEvent::ToValue(
const ProtocolEvent& event) {
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
-
+ auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetDouble("time", event.GetTimestamp().ToJsTime());
dict->SetString("type", event.GetType());
dict->SetString("details", event.GetDetails());
- dict->Set("proto", event.GetProtoMessage().release());
-
+ dict->Set("proto", event.GetProtoMessage());
return dict;
}

Powered by Google App Engine
This is Rietveld 408576698