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

Side by Side Diff: gin/shell/gin_main.cc

Issue 1917053003: unique_ptr_migration: clean up references to scoped_ptr as of r389721 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 unified diff | Download patch
« no previous file with comments | « device/usb/usb_device_handle_usbfs.cc ('k') | gin/shell_runner.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/i18n/icu_util.h" 10 #include "base/i18n/icu_util.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ptr_util.h"
12 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
13 #include "gin/array_buffer.h" 14 #include "gin/array_buffer.h"
14 #include "gin/modules/console.h" 15 #include "gin/modules/console.h"
15 #include "gin/modules/module_runner_delegate.h" 16 #include "gin/modules/module_runner_delegate.h"
16 #include "gin/public/isolate_holder.h" 17 #include "gin/public/isolate_holder.h"
17 #include "gin/try_catch.h" 18 #include "gin/try_catch.h"
18 #include "gin/v8_initializer.h" 19 #include "gin/v8_initializer.h"
19 20
20 namespace gin { 21 namespace gin {
21 namespace { 22 namespace {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 base::CommandLine::Init(argc, argv); 64 base::CommandLine::Init(argc, argv);
64 base::i18n::InitializeICU(); 65 base::i18n::InitializeICU();
65 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 66 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
66 gin::V8Initializer::LoadV8Snapshot(); 67 gin::V8Initializer::LoadV8Snapshot();
67 gin::V8Initializer::LoadV8Natives(); 68 gin::V8Initializer::LoadV8Natives();
68 #endif 69 #endif
69 70
70 base::MessageLoop message_loop; 71 base::MessageLoop message_loop;
71 72
72 // Initialize the base::FeatureList since IsolateHolder can depend on it. 73 // Initialize the base::FeatureList since IsolateHolder can depend on it.
73 base::FeatureList::SetInstance(make_scoped_ptr(new base::FeatureList)); 74 base::FeatureList::SetInstance(base::WrapUnique(new base::FeatureList));
74 75
75 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, 76 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
76 gin::IsolateHolder::kStableV8Extras, 77 gin::IsolateHolder::kStableV8Extras,
77 gin::ArrayBufferAllocator::SharedInstance()); 78 gin::ArrayBufferAllocator::SharedInstance());
78 gin::IsolateHolder instance; 79 gin::IsolateHolder instance;
79 80
80 81
81 gin::GinShellRunnerDelegate delegate; 82 gin::GinShellRunnerDelegate delegate;
82 gin::ShellRunner runner(&delegate, instance.isolate()); 83 gin::ShellRunner runner(&delegate, instance.isolate());
83 84
84 { 85 {
85 gin::Runner::Scope scope(&runner); 86 gin::Runner::Scope scope(&runner);
86 runner.GetContextHolder() 87 runner.GetContextHolder()
87 ->isolate() 88 ->isolate()
88 ->SetCaptureStackTraceForUncaughtExceptions(true); 89 ->SetCaptureStackTraceForUncaughtExceptions(true);
89 } 90 }
90 91
91 base::CommandLine::StringVector args = 92 base::CommandLine::StringVector args =
92 base::CommandLine::ForCurrentProcess()->GetArgs(); 93 base::CommandLine::ForCurrentProcess()->GetArgs();
93 for (base::CommandLine::StringVector::const_iterator it = args.begin(); 94 for (base::CommandLine::StringVector::const_iterator it = args.begin();
94 it != args.end(); ++it) { 95 it != args.end(); ++it) {
95 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( 96 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
96 gin::Run, runner.GetWeakPtr(), base::FilePath(*it))); 97 gin::Run, runner.GetWeakPtr(), base::FilePath(*it)));
97 } 98 }
98 99
99 message_loop.RunUntilIdle(); 100 message_loop.RunUntilIdle();
100 return 0; 101 return 0;
101 } 102 }
OLDNEW
« no previous file with comments | « device/usb/usb_device_handle_usbfs.cc ('k') | gin/shell_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698