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

Unified Diff: mojo/nacl/nonsfi/irt_pnacl_translator_compile.cc

Issue 2069663002: Some scoped_ptr -> std::unique_ptr conversion, especially under //mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 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 | « mojo/nacl/nonsfi/file_util.cc ('k') | services/dart/content_handler_app.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/nacl/nonsfi/irt_pnacl_translator_compile.cc
diff --git a/mojo/nacl/nonsfi/irt_pnacl_translator_compile.cc b/mojo/nacl/nonsfi/irt_pnacl_translator_compile.cc
index 71a30bae1fe1e314811fb0bcd18cad2abbd74e0a..569db631afa88ffe4a82eb7523269050866077ba 100644
--- a/mojo/nacl/nonsfi/irt_pnacl_translator_compile.cc
+++ b/mojo/nacl/nonsfi/irt_pnacl_translator_compile.cc
@@ -3,6 +3,9 @@
// found in the LICENSE file.
#include <fcntl.h>
+#include <stdio.h>
+
+#include <memory>
#include "base/files/file_util.h"
#include "base/logging.h"
@@ -41,7 +44,7 @@ class PexeCompilerImpl : public mojo::nacl::PexeCompiler {
for (size_t i = 0; i < obj_file_count; i++) {
base::FilePath obj_file_name;
- CHECK(CreateTemporaryFile(&obj_file_name))
+ CHECK(base::CreateTemporaryFile(&obj_file_name))
<< "Could not make temporary object file";
obj_file_fds[i] = open(obj_file_name.value().c_str(), O_RDWR, O_TRUNC);
CHECK_GE(obj_file_fds[i], 0)
@@ -76,7 +79,7 @@ class PexeCompilerImpl : public mojo::nacl::PexeCompiler {
// Read the pexe using fread, and write the pexe into the callback function.
static const size_t kBufferSize = 0x100000;
- scoped_ptr<char[]> buf(new char[kBufferSize]);
+ std::unique_ptr<char[]> buf(new char[kBufferSize]);
FILE* pexe_file_stream = fopen(pexe_file_name.get().c_str(), "r");
// Once the pexe has been opened, it is no longer needed, so we unlink it.
CHECK(!unlink(pexe_file_name.get().c_str()))
« no previous file with comments | « mojo/nacl/nonsfi/file_util.cc ('k') | services/dart/content_handler_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698