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

Side by Side Diff: mojo/dart/dart_snapshotter/main.cc

Issue 1351293002: Convert remaining scoped_ptr -> std::unique_ptr in //mojo/edk (minus js). (Closed) Base URL: https://github.com/domokit/mojo.git@edk_unique_ptr_5
Patch Set: oops, forgot to fix android Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « mojo/android/javatests/init_library.cc ('k') | mojo/edk/embedder/BUILD.gn » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include <iostream> 5 #include <iostream>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 const base::CommandLine& command_line = 55 const base::CommandLine& command_line =
56 *base::CommandLine::ForCurrentProcess(); 56 *base::CommandLine::ForCurrentProcess();
57 57
58 if (command_line.HasSwitch(kHelp) || command_line.GetArgs().empty()) { 58 if (command_line.HasSwitch(kHelp) || command_line.GetArgs().empty()) {
59 Usage(); 59 Usage();
60 return 0; 60 return 0;
61 } 61 }
62 62
63 // Initialize mojo. 63 // Initialize mojo.
64 mojo::embedder::Init( 64 // TODO(vtl): Use make_unique when C++14 is available.
65 make_scoped_ptr(new mojo::embedder::SimplePlatformSupport())); 65 mojo::embedder::Init(std::unique_ptr<mojo::embedder::PlatformSupport>(
66 new mojo::embedder::SimplePlatformSupport()));
66 67
67 InitDartVM(); 68 InitDartVM();
68 69
69 CHECK(command_line.HasSwitch(kPackageRoot)) << "Need --package-root"; 70 CHECK(command_line.HasSwitch(kPackageRoot)) << "Need --package-root";
70 CHECK(command_line.HasSwitch(kSnapshot)) << "Need --snapshot"; 71 CHECK(command_line.HasSwitch(kSnapshot)) << "Need --snapshot";
71 auto args = command_line.GetArgs(); 72 auto args = command_line.GetArgs();
72 CHECK(args.size() == 1); 73 CHECK(args.size() == 1);
73 74
74 Dart_Isolate isolate = CreateDartIsolate(); 75 Dart_Isolate isolate = CreateDartIsolate();
75 CHECK(isolate); 76 CHECK(isolate);
(...skipping 15 matching lines...) Expand all
91 92
92 // Load script. 93 // Load script.
93 tonic::DartScriptLoaderSync::LoadScript(args[0], 94 tonic::DartScriptLoaderSync::LoadScript(args[0],
94 isolate_data->library_provider()); 95 isolate_data->library_provider());
95 96
96 // Write snapshot. 97 // Write snapshot.
97 WriteSnapshot(command_line.GetSwitchValuePath(kSnapshot)); 98 WriteSnapshot(command_line.GetSwitchValuePath(kSnapshot));
98 99
99 return 0; 100 return 0;
100 } 101 }
OLDNEW
« no previous file with comments | « mojo/android/javatests/init_library.cc ('k') | mojo/edk/embedder/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698