Index: content/renderer/mojo_bindings_controller.cc |
diff --git a/content/renderer/mojo_bindings_controller.cc b/content/renderer/mojo_bindings_controller.cc |
index 7a2b3b18f6cc512634e0ba22ac040c9dc97a2b68..4404a01d2b49e4a17165314a5c253d6b94704701 100644 |
--- a/content/renderer/mojo_bindings_controller.cc |
+++ b/content/renderer/mojo_bindings_controller.cc |
@@ -4,6 +4,7 @@ |
#include "content/renderer/mojo_bindings_controller.h" |
+#include "base/memory/ptr_util.h" |
#include "content/common/view_messages.h" |
#include "content/public/renderer/render_frame.h" |
#include "content/public/renderer/render_view.h" |
@@ -40,9 +41,9 @@ void MojoBindingsController::CreateContextState() { |
blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); |
v8::Local<v8::Context> context = frame->MainWorldScriptContext(); |
gin::PerContextData* context_data = gin::PerContextData::From(context); |
- MojoContextStateData* data = new MojoContextStateData; |
+ auto data = base::MakeUnique<MojoContextStateData>(); |
data->state.reset(new MojoContextState(frame, context, bindings_type_)); |
- context_data->SetUserData(kMojoContextStateKey, data); |
+ context_data->SetUserData(kMojoContextStateKey, std::move(data)); |
} |
void MojoBindingsController::DestroyContextState( |