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

Side by Side Diff: services/service_manager/public/cpp/lib/service_runner.cc

Issue 2566663004: Revert of Build services as standalone executables (Closed)
Patch Set: Created 4 years 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/service_manager/native_runner.h ('k') | services/service_manager/public/cpp/service.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/service_manager/public/cpp/service_runner.h" 5 #include "services/service_manager/public/cpp/service_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/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Note that we destruct the message loop first because that might trigger 64 // Note that we destruct the message loop first because that might trigger
65 // connection error handlers and they might access objects created by the 65 // connection error handlers and they might access objects created by the
66 // service. 66 // service.
67 loop.reset(); 67 loop.reset();
68 context_.reset(); 68 context_.reset();
69 } 69 }
70 return MOJO_RESULT_OK; 70 return MOJO_RESULT_OK;
71 } 71 }
72 72
73 MojoResult ServiceRunner::Run(MojoHandle service_request_handle) { 73 MojoResult ServiceRunner::Run(MojoHandle service_request_handle) {
74 return Run(service_request_handle, false); 74 bool init_base = true;
75 if (base::CommandLine::InitializedForCurrentProcess()) {
76 init_base =
77 !base::CommandLine::ForCurrentProcess()->HasSwitch("single-process");
78 }
79 return Run(service_request_handle, init_base);
75 } 80 }
76 81
77 void ServiceRunner::Quit() { 82 void ServiceRunner::Quit() {
78 base::MessageLoop::current()->QuitWhenIdle(); 83 base::MessageLoop::current()->QuitWhenIdle();
79 } 84 }
80 85
81 } // namespace service_manager 86 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/service_manager/native_runner.h ('k') | services/service_manager/public/cpp/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698