| OLD | NEW |
| 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 "ipc/mojo/scoped_ipc_support.h" | 5 #include "mojo/edk/embedder/scoped_ipc_support.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "mojo/edk/embedder/embedder.h" | 10 #include "mojo/edk/embedder/embedder.h" |
| 11 #include "mojo/edk/embedder/process_delegate.h" | 11 #include "mojo/edk/embedder/process_delegate.h" |
| 12 | 12 |
| 13 namespace IPC { | 13 namespace mojo { |
| 14 namespace edk { |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 class IPCSupportInitializer : public mojo::edk::ProcessDelegate { | 17 class IPCSupportInitializer : public mojo::edk::ProcessDelegate { |
| 17 public: | 18 public: |
| 18 IPCSupportInitializer() {} | 19 IPCSupportInitializer() {} |
| 19 ~IPCSupportInitializer() override {} | 20 ~IPCSupportInitializer() override {} |
| 20 | 21 |
| 21 void Init(scoped_refptr<base::TaskRunner> io_thread_task_runner) { | 22 void Init(scoped_refptr<base::TaskRunner> io_thread_task_runner) { |
| 22 CHECK(!io_thread_task_runner_); | 23 CHECK(!io_thread_task_runner_); |
| 23 CHECK(io_thread_task_runner); | 24 CHECK(io_thread_task_runner); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 49 | 50 |
| 50 ScopedIPCSupport::ScopedIPCSupport( | 51 ScopedIPCSupport::ScopedIPCSupport( |
| 51 scoped_refptr<base::TaskRunner> io_thread_task_runner) { | 52 scoped_refptr<base::TaskRunner> io_thread_task_runner) { |
| 52 ipc_support_initializer.Get().Init(io_thread_task_runner); | 53 ipc_support_initializer.Get().Init(io_thread_task_runner); |
| 53 } | 54 } |
| 54 | 55 |
| 55 ScopedIPCSupport::~ScopedIPCSupport() { | 56 ScopedIPCSupport::~ScopedIPCSupport() { |
| 56 ipc_support_initializer.Get().ShutDown(); | 57 ipc_support_initializer.Get().ShutDown(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 } // namespace IPC | 60 } // namespace edk |
| 61 } // namespace mojo |
| OLD | NEW |