Don't preload rarely seen large images
[chromium-blink-merge.git] / components / nacl / renderer / trusted_plugin_channel.h
blobd657d5338e187d95de34eac1af8275abfd21f0d9
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_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_
6 #define COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ipc/ipc_listener.h"
11 #include "native_client/src/trusted/service_runtime/nacl_error_code.h"
12 #include "ppapi/c/pp_instance.h"
14 namespace base {
15 class WaitableEvent;
16 } // namespace base
18 namespace IPC {
19 struct ChannelHandle;
20 class Message;
21 class SyncChannel;
22 } // namespace IPC
24 namespace nacl {
25 class NexeLoadManager;
27 class TrustedPluginChannel : public IPC::Listener {
28 public:
29 TrustedPluginChannel(NexeLoadManager* nexe_load_manager,
30 const IPC::ChannelHandle& handle,
31 base::WaitableEvent* shutdown_event,
32 bool is_helper_nexe);
33 ~TrustedPluginChannel() override;
35 bool Send(IPC::Message* message);
37 // Listener implementation.
38 bool OnMessageReceived(const IPC::Message& message) override;
39 void OnChannelError() override;
41 void OnReportExitStatus(int exit_status);
42 void OnReportLoadStatus(NaClErrorCode load_status);
44 private:
45 // Non-owning pointer. This is safe because the TrustedPluginChannel is owned
46 // by the NexeLoadManager pointed to here.
47 NexeLoadManager* nexe_load_manager_;
48 scoped_ptr<IPC::SyncChannel> channel_;
49 bool is_helper_nexe_;
51 DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel);
54 } // namespace nacl
56 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_