| 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 #ifndef IPC_MOJO_SCOPED_IPC_SUPPORT_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_SCOPED_IPC_SUPPORT_H_ |
| 6 #define IPC_MOJO_SCOPED_IPC_SUPPORT_H_ | 6 #define MOJO_EDK_EMBEDDER_SCOPED_IPC_SUPPORT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/task_runner.h" | 10 #include "base/task_runner.h" |
| 11 #include "mojo/edk/system/system_impl_export.h" |
| 11 | 12 |
| 12 namespace IPC { | 13 namespace mojo { |
| 14 namespace edk { |
| 13 | 15 |
| 14 // Performs any necessary Mojo IPC initialization on construction, and shuts | 16 // Performs any necessary Mojo initialization on construction, and shuts |
| 15 // down Mojo IPC on destruction. | 17 // down Mojo on destruction. |
| 16 // | 18 // |
| 17 // This should be instantiated once per process and retained as long as Mojo IPC | 19 // This should be instantiated once per process and retained as long as Mojo |
| 18 // is needed. The TaskRunner passed to the constructor should outlive this | 20 // is needed. The TaskRunner passed to the constructor should outlive this |
| 19 // object. | 21 // object. |
| 20 class ScopedIPCSupport { | 22 class MOJO_SYSTEM_IMPL_EXPORT ScopedIPCSupport { |
| 21 public: | 23 public: |
| 22 ScopedIPCSupport(scoped_refptr<base::TaskRunner> io_thread_task_runner); | 24 ScopedIPCSupport(scoped_refptr<base::TaskRunner> io_thread_task_runner); |
| 23 ~ScopedIPCSupport(); | 25 ~ScopedIPCSupport(); |
| 24 | 26 |
| 25 private: | 27 private: |
| 26 DISALLOW_COPY_AND_ASSIGN(ScopedIPCSupport); | 28 DISALLOW_COPY_AND_ASSIGN(ScopedIPCSupport); |
| 27 }; | 29 }; |
| 28 | 30 |
| 29 } // namespace IPC | 31 } // namespace edk |
| 32 } // namespace mojo |
| 30 | 33 |
| 31 #endif // IPC_MOJO_SCOPED_IPC_SUPPORT_H_ | 34 #endif // MOJO_EDK_EMBEDDER_SCOPED_IPC_SUPPORT_H_ |
| OLD | NEW |