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 COMPONENTS_NACL_LOADER_NONSFI_NONSFI_LISTENER_H_
6 #define COMPONENTS_NACL_LOADER_NONSFI_NONSFI_LISTENER_H_
8 #include "base/macros.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/synchronization/waitable_event.h"
13 #include "base/threading/thread.h"
14 #include "ipc/ipc_listener.h"
21 class NaClTrustedListener;
25 struct NaClStartParams;
29 class NonSfiListener : public IPC::Listener {
32 virtual ~NonSfiListener();
34 // Listen for a request to launch a non-SFI NaCl module.
36 bool Send(IPC::Message* msg);
39 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
40 void OnStart(const nacl::NaClStartParams& params);
42 base::Thread io_thread_;
43 base::WaitableEvent shutdown_event_;
44 scoped_ptr<IPC::SyncChannel> channel_;
45 scoped_refptr<NaClTrustedListener> trusted_listener_;
47 DISALLOW_COPY_AND_ASSIGN(NonSfiListener);
53 #endif // COMPONENTS_NACL_LOADER_NONSFI_NONSFI_LISTENER_H_