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

Side by Side Diff: services/shell/runner/child/test_native_main.cc

Issue 2179023004: Make Service own ServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/runner/child/test_native_main.h" 5 #include "services/shell/runner/child/test_native_main.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 ProcessDelegate process_delegate; 52 ProcessDelegate process_delegate;
53 base::Thread io_thread("io_thread"); 53 base::Thread io_thread("io_thread");
54 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); 54 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0);
55 CHECK(io_thread.StartWithOptions(io_thread_options)); 55 CHECK(io_thread.StartWithOptions(io_thread_options));
56 56
57 mojo::edk::InitIPCSupport(&process_delegate, io_thread.task_runner()); 57 mojo::edk::InitIPCSupport(&process_delegate, io_thread.task_runner());
58 mojo::edk::SetParentPipeHandleFromCommandLine(); 58 mojo::edk::SetParentPipeHandleFromCommandLine();
59 59
60 base::MessageLoop loop; 60 base::MessageLoop loop;
61 shell::ServiceContext impl(service, 61 service->set_context(base::WrapUnique(new shell::ServiceContext(
62 shell::GetServiceRequestFromCommandLine()); 62 service, shell::GetServiceRequestFromCommandLine())));
63 base::RunLoop().Run(); 63 base::RunLoop().Run();
64 64
65 mojo::edk::ShutdownIPCSupport(); 65 mojo::edk::ShutdownIPCSupport();
66
67 service->set_context(std::unique_ptr<ServiceContext>());
66 } 68 }
67 69
68 return 0; 70 return 0;
69 } 71 }
70 72
71 } // namespace shell 73 } // namespace shell
OLDNEW
« no previous file with comments | « services/shell/public/interfaces/service_manager.mojom ('k') | services/shell/service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698