blob: 008473185ad9615dd45bf30345fe820863aa0b5d [file] [log] [blame]
[email protected]cd2af392012-01-31 09:19:171// Copyright (c) 2012 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.
4
5#ifndef PPAPI_PPB_FLASH_MESSAGE_LOOP_PROXY_H_
6#define PPAPI_PPB_FLASH_MESSAGE_LOOP_PROXY_H_
7
avie029c4132015-12-23 06:45:228#include <stdint.h>
9
dchengced92242016-04-07 00:00:1210#include <memory>
11
[email protected]cd2af392012-01-31 09:19:1712#include "base/compiler_specific.h"
avie029c4132015-12-23 06:45:2213#include "base/macros.h"
[email protected]cd2af392012-01-31 09:19:1714#include "base/memory/weak_ptr.h"
15#include "ppapi/c/pp_instance.h"
16#include "ppapi/c/pp_resource.h"
17#include "ppapi/proxy/interface_proxy.h"
18
19namespace IPC {
20class Message;
21}
22
23namespace ppapi {
24
25class HostResource;
26
27namespace proxy {
28
29class PPB_Flash_MessageLoop_Proxy
30 : public InterfaceProxy,
31 public base::SupportsWeakPtr<PPB_Flash_MessageLoop_Proxy> {
32 public:
33 explicit PPB_Flash_MessageLoop_Proxy(Dispatcher* dispatcher);
nicke4784432015-04-23 14:01:4834 ~PPB_Flash_MessageLoop_Proxy() override;
[email protected]cd2af392012-01-31 09:19:1735
36 static PP_Resource CreateProxyResource(PP_Instance instance);
37
38 // InterfaceProxy implementation.
nicke4784432015-04-23 14:01:4839 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]cd2af392012-01-31 09:19:1740
[email protected]724fbd32012-04-30 16:19:4141 static const ApiID kApiID = API_ID_PPB_FLASH_MESSAGELOOP;
42
[email protected]cd2af392012-01-31 09:19:1743 private:
44 void OnMsgCreate(PP_Instance instance, ppapi::HostResource* resource);
45 void OnMsgRun(const ppapi::HostResource& flash_message_loop,
46 IPC::Message* reply);
47 void OnMsgQuit(const ppapi::HostResource& flash_message_loop);
48
dchengced92242016-04-07 00:00:1249 void WillQuitSoon(std::unique_ptr<IPC::Message> reply_message,
50 int32_t result);
[email protected]cd2af392012-01-31 09:19:1751
52 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_MessageLoop_Proxy);
53};
54
55} // namespace proxy
56} // namespace ppapi
57
58#endif // PPAPI_PPB_FLASH_MESSAGE_LOOP_PROXY_H_