Chromium Code Reviews| 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 "mojo/shell/context.h" | 5 #include "mojo/shell/context.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual void OnServiceError(ServiceManager* manager, | 78 virtual void OnServiceError(ServiceManager* manager, |
| 79 const GURL& url) OVERRIDE { | 79 const GURL& url) OVERRIDE { |
| 80 } | 80 } |
| 81 | 81 |
| 82 scoped_ptr<ApplicationImpl> app_; | 82 scoped_ptr<ApplicationImpl> app_; |
| 83 DISALLOW_COPY_AND_ASSIGN(NativeViewportServiceLoader); | 83 DISALLOW_COPY_AND_ASSIGN(NativeViewportServiceLoader); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 Context::Context() | 86 Context::Context() { |
| 87 : task_runners_(base::MessageLoop::current()->message_loop_proxy()) { | 87 DCHECK(!base::MessageLoop::current()); |
|
darin (slow to review)
2014/07/28 23:02:12
perhaps the dtor should have a similar assertion?
tim (not reviewing)
2014/07/29 00:54:57
Done.
| |
| 88 } | |
| 89 | |
| 90 void Context::Init() { | |
| 88 setup.Get(); | 91 setup.Get(); |
| 92 task_runners_.reset( | |
| 93 new TaskRunners(base::MessageLoop::current()->message_loop_proxy())); | |
| 89 | 94 |
| 90 for (size_t i = 0; i < arraysize(kLocalMojoURLs); ++i) | 95 for (size_t i = 0; i < arraysize(kLocalMojoURLs); ++i) |
| 91 mojo_url_resolver_.AddLocalFileMapping(GURL(kLocalMojoURLs[i])); | 96 mojo_url_resolver_.AddLocalFileMapping(GURL(kLocalMojoURLs[i])); |
| 92 | 97 |
| 93 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); | 98 base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); |
| 94 scoped_ptr<DynamicServiceRunnerFactory> runner_factory; | 99 scoped_ptr<DynamicServiceRunnerFactory> runner_factory; |
| 95 if (cmdline->HasSwitch(switches::kEnableMultiprocess)) | 100 if (cmdline->HasSwitch(switches::kEnableMultiprocess)) |
| 96 runner_factory.reset(new OutOfProcessDynamicServiceRunnerFactory()); | 101 runner_factory.reset(new OutOfProcessDynamicServiceRunnerFactory()); |
| 97 else | 102 else |
| 98 runner_factory.reset(new InProcessDynamicServiceRunnerFactory()); | 103 runner_factory.reset(new InProcessDynamicServiceRunnerFactory()); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); | 167 service_manager_.set_default_loader(scoped_ptr<ServiceLoader>()); |
| 163 service_manager_.TerminateShellConnections(); | 168 service_manager_.TerminateShellConnections(); |
| 164 } | 169 } |
| 165 | 170 |
| 166 Context::~Context() { | 171 Context::~Context() { |
| 167 Shutdown(); | 172 Shutdown(); |
| 168 } | 173 } |
| 169 | 174 |
| 170 } // namespace shell | 175 } // namespace shell |
| 171 } // namespace mojo | 176 } // namespace mojo |
| OLD | NEW |