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