| 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 27 matching lines...) Expand all Loading... |
| 38 return module_base; | 38 return module_base; |
| 39 } | 39 } |
| 40 | 40 |
| 41 class GinShellRunnerDelegate : public ModuleRunnerDelegate { | 41 class GinShellRunnerDelegate : public ModuleRunnerDelegate { |
| 42 public: | 42 public: |
| 43 GinShellRunnerDelegate() : ModuleRunnerDelegate(GetModuleSearchPaths()) { | 43 GinShellRunnerDelegate() : ModuleRunnerDelegate(GetModuleSearchPaths()) { |
| 44 AddBuiltinModule(Console::kModuleName, Console::GetModule); | 44 AddBuiltinModule(Console::kModuleName, Console::GetModule); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void UnhandledException(ShellRunner* runner, | 47 virtual void UnhandledException(ShellRunner* runner, |
| 48 TryCatch& try_catch) OVERRIDE { | 48 TryCatch& try_catch) override { |
| 49 ModuleRunnerDelegate::UnhandledException(runner, try_catch); | 49 ModuleRunnerDelegate::UnhandledException(runner, try_catch); |
| 50 LOG(ERROR) << try_catch.GetStackTrace(); | 50 LOG(ERROR) << try_catch.GetStackTrace(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 DISALLOW_COPY_AND_ASSIGN(GinShellRunnerDelegate); | 54 DISALLOW_COPY_AND_ASSIGN(GinShellRunnerDelegate); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 } // namespace gin | 58 } // namespace gin |
| (...skipping 20 matching lines...) Expand all Loading... |
| 79 CommandLine::StringVector args = CommandLine::ForCurrentProcess()->GetArgs(); | 79 CommandLine::StringVector args = CommandLine::ForCurrentProcess()->GetArgs(); |
| 80 for (CommandLine::StringVector::const_iterator it = args.begin(); | 80 for (CommandLine::StringVector::const_iterator it = args.begin(); |
| 81 it != args.end(); ++it) { | 81 it != args.end(); ++it) { |
| 82 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( | 82 base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( |
| 83 gin::Run, runner.GetWeakPtr(), base::FilePath(*it))); | 83 gin::Run, runner.GetWeakPtr(), base::FilePath(*it))); |
| 84 } | 84 } |
| 85 | 85 |
| 86 message_loop.RunUntilIdle(); | 86 message_loop.RunUntilIdle(); |
| 87 return 0; | 87 return 0; |
| 88 } | 88 } |
| OLD | NEW |