OLD | NEW |
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/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/i18n/icu_util.h" | 9 #include "base/i18n/icu_util.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 base::CommandLine::Init(argc, argv); | 61 base::CommandLine::Init(argc, argv); |
62 base::i18n::InitializeICU(); | 62 base::i18n::InitializeICU(); |
63 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 63 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
64 gin::V8Initializer::LoadV8Snapshot(); | 64 gin::V8Initializer::LoadV8Snapshot(); |
65 gin::V8Initializer::LoadV8Natives(); | 65 gin::V8Initializer::LoadV8Natives(); |
66 #endif | 66 #endif |
67 | 67 |
68 base::MessageLoop message_loop; | 68 base::MessageLoop message_loop; |
69 | 69 |
70 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, | 70 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, |
| 71 gin::IsolateHolder::kStableV8Extras, |
71 gin::ArrayBufferAllocator::SharedInstance()); | 72 gin::ArrayBufferAllocator::SharedInstance()); |
72 gin::IsolateHolder instance; | 73 gin::IsolateHolder instance; |
73 | 74 |
74 | 75 |
75 gin::GinShellRunnerDelegate delegate; | 76 gin::GinShellRunnerDelegate delegate; |
76 gin::ShellRunner runner(&delegate, instance.isolate()); | 77 gin::ShellRunner runner(&delegate, instance.isolate()); |
77 | 78 |
78 { | 79 { |
79 gin::Runner::Scope scope(&runner); | 80 gin::Runner::Scope scope(&runner); |
80 runner.GetContextHolder() | 81 runner.GetContextHolder() |
81 ->isolate() | 82 ->isolate() |
82 ->SetCaptureStackTraceForUncaughtExceptions(true); | 83 ->SetCaptureStackTraceForUncaughtExceptions(true); |
83 } | 84 } |
84 | 85 |
85 base::CommandLine::StringVector args = | 86 base::CommandLine::StringVector args = |
86 base::CommandLine::ForCurrentProcess()->GetArgs(); | 87 base::CommandLine::ForCurrentProcess()->GetArgs(); |
87 for (base::CommandLine::StringVector::const_iterator it = args.begin(); | 88 for (base::CommandLine::StringVector::const_iterator it = args.begin(); |
88 it != args.end(); ++it) { | 89 it != args.end(); ++it) { |
89 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( | 90 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( |
90 gin::Run, runner.GetWeakPtr(), base::FilePath(*it))); | 91 gin::Run, runner.GetWeakPtr(), base::FilePath(*it))); |
91 } | 92 } |
92 | 93 |
93 message_loop.RunUntilIdle(); | 94 message_loop.RunUntilIdle(); |
94 return 0; | 95 return 0; |
95 } | 96 } |
OLD | NEW |