| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/app/mash/mash_runner.h" | 5 #include "chrome/app/mash/mash_runner.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 void MashRunner::RunMain() { | 103 void MashRunner::RunMain() { |
| 104 // TODO(sky): refactor backgroundshell so can supply own context, we | 104 // TODO(sky): refactor backgroundshell so can supply own context, we |
| 105 // shouldn't we using context as it has a lot of stuff we don't really want | 105 // shouldn't we using context as it has a lot of stuff we don't really want |
| 106 // in chrome. | 106 // in chrome. |
| 107 NativeRunnerDelegateImpl native_runner_delegate; | 107 NativeRunnerDelegateImpl native_runner_delegate; |
| 108 shell::BackgroundShell background_shell; | 108 shell::BackgroundShell background_shell; |
| 109 std::unique_ptr<shell::BackgroundShell::InitParams> init_params( | 109 std::unique_ptr<shell::BackgroundShell::InitParams> init_params( |
| 110 new shell::BackgroundShell::InitParams); | 110 new shell::BackgroundShell::InitParams); |
| 111 init_params->native_runner_delegate = &native_runner_delegate; | 111 init_params->native_runner_delegate = &native_runner_delegate; |
| 112 init_params->override_resource_path = base::FilePath::kCurrentDirectory; |
| 112 background_shell.Init(std::move(init_params)); | 113 background_shell.Init(std::move(init_params)); |
| 113 service_.reset(new mash::MashPackagedService); | 114 service_.reset(new mash::MashPackagedService); |
| 114 service_->set_context(base::MakeUnique<shell::ServiceContext>( | 115 service_->set_context(base::MakeUnique<shell::ServiceContext>( |
| 115 service_.get(), | 116 service_.get(), |
| 116 background_shell.CreateServiceRequest("exe:chrome_mash"))); | 117 background_shell.CreateServiceRequest("exe:chrome_mash"))); |
| 117 service_->connector()->Connect("mojo:mash_session"); | 118 service_->connector()->Connect("mojo:mash_session"); |
| 118 base::RunLoop().Run(); | 119 base::RunLoop().Run(); |
| 119 } | 120 } |
| 120 | 121 |
| 121 void MashRunner::RunChild() { | 122 void MashRunner::RunChild() { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 tracing::GetConfigForTraceToConsole(); | 165 tracing::GetConfigForTraceToConsole(); |
| 165 base::trace_event::TraceLog::GetInstance()->SetEnabled( | 166 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
| 166 trace_config, | 167 trace_config, |
| 167 base::trace_event::TraceLog::RECORDING_MODE); | 168 base::trace_event::TraceLog::RECORDING_MODE); |
| 168 } | 169 } |
| 169 | 170 |
| 170 MashRunner mash_runner; | 171 MashRunner mash_runner; |
| 171 mash_runner.Run(); | 172 mash_runner.Run(); |
| 172 return 0; | 173 return 0; |
| 173 } | 174 } |
| OLD | NEW |