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

Side by Side Diff: services/shell/background/background_shell.cc

Issue 2377203005: services/shell: Allow injecting the location of resources.
Patch Set: Created 4 years, 2 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 | « services/shell/background/background_shell.h ('k') | services/shell/standalone/context.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 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 "services/shell/background/background_shell.h" 5 #include "services/shell/background/background_shell.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 std::unique_ptr<base::MessageLoop> message_loop(message_loop_); 94 std::unique_ptr<base::MessageLoop> message_loop(message_loop_);
95 95
96 std::unique_ptr<Context::InitParams> context_init_params( 96 std::unique_ptr<Context::InitParams> context_init_params(
97 new Context::InitParams); 97 new Context::InitParams);
98 if (init_params_) { 98 if (init_params_) {
99 context_init_params->catalog_store = 99 context_init_params->catalog_store =
100 std::move(init_params_->catalog_store); 100 std::move(init_params_->catalog_store);
101 context_init_params->native_runner_delegate = 101 context_init_params->native_runner_delegate =
102 init_params_->native_runner_delegate; 102 init_params_->native_runner_delegate;
103 context_init_params->init_edk = init_params_->init_edk; 103 context_init_params->init_edk = init_params_->init_edk;
104 context_init_params->override_resource_path =
105 init_params_->override_resource_path;
104 } 106 }
105 if (context_init_params->init_edk) 107 if (context_init_params->init_edk)
106 Context::EnsureEmbedderIsInitialized(); 108 Context::EnsureEmbedderIsInitialized();
107 109
108 message_loop_->BindToCurrentThread(); 110 message_loop_->BindToCurrentThread();
109 111
110 std::unique_ptr<Context> context(new Context); 112 std::unique_ptr<Context> context(new Context);
111 context_ = context.get(); 113 context_ = context.get();
112 context_->Init(std::move(context_init_params)); 114 context_->Init(std::move(context_init_params));
113 115
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 171 }
170 172
171 void BackgroundShell::ExecuteOnServiceManagerThread( 173 void BackgroundShell::ExecuteOnServiceManagerThread(
172 const ServiceManagerThreadCallback& callback) { 174 const ServiceManagerThreadCallback& callback) {
173 thread_->message_loop()->task_runner()->PostTask( 175 thread_->message_loop()->task_runner()->PostTask(
174 FROM_HERE, base::Bind(&MojoThread::RunServiceManagerCallback, 176 FROM_HERE, base::Bind(&MojoThread::RunServiceManagerCallback,
175 base::Unretained(thread_.get()), callback)); 177 base::Unretained(thread_.get()), callback));
176 } 178 }
177 179
178 } // namespace shell 180 } // namespace shell
OLDNEW
« no previous file with comments | « services/shell/background/background_shell.h ('k') | services/shell/standalone/context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698