GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / ipc / mojo / ipc_channel_mojo_host.h
blobdb60b12a4ccab48090e1d8caf331554a1dfc8468
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IPC_IPC_CHANNEL_MOJO_HOST_H_
6 #define IPC_IPC_CHANNEL_MOJO_HOST_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/process/process_handle.h"
11 #include "ipc/ipc_export.h"
12 #include "ipc/mojo/ipc_channel_mojo.h"
14 namespace base {
15 class SequencedTaskRunner;
18 namespace IPC {
20 // Through ChannelMojoHost, ChannelMojo gets extra information that
21 // its client provides, including the child process's process handle. Every
22 // server process that uses ChannelMojo must have a ChannelMojoHost
23 // instance and call OnClientLaunched().
24 class IPC_MOJO_EXPORT ChannelMojoHost {
25 public:
26 explicit ChannelMojoHost(
27 scoped_refptr<base::SequencedTaskRunner> io_task_runner);
28 ~ChannelMojoHost();
30 void OnClientLaunched(base::ProcessHandle process);
31 ChannelMojo::Delegate* channel_delegate() const;
33 private:
34 class ChannelDelegate;
35 class ChannelDelegateTraits;
37 const scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
38 scoped_refptr<ChannelDelegate> channel_delegate_;
39 base::WeakPtrFactory<ChannelMojoHost> weak_factory_;
41 DISALLOW_COPY_AND_ASSIGN(ChannelMojoHost);
44 } // namespace IPC
46 #endif // IPC_IPC_CHANNEL_MOJO_HOST_H_