Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: ppapi/host/ppapi_host.h

Issue 10544089: Implement the file chooser as a new resource "host" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/host/host_message_context.h ('k') | ppapi/host/ppapi_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // 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_HOST_PPAPI_HOST_H_
6 #define PPAPI_HOST_PPAPI_HOST_H_
7
8 #include <map>
9
10 #include "base/memory/linked_ptr.h"
11 #include "ipc/ipc_channel.h"
12 #include "ipc/ipc_message.h"
13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/host/ppapi_host_export.h"
16
17 namespace ppapi {
18
19 namespace proxy {
20 class ResourceMessageCallParams;
21 class ResourceMessageReplyParams;
22 }
23
24 namespace host {
25
26 class HostFactory;
27 class ResourceHost;
28
29 class PPAPI_HOST_EXPORT PpapiHost
30 : public IPC::Message::Sender,
31 public IPC::Channel::Listener {
32 public:
33 PpapiHost(IPC::Message::Sender* sender,
34 HostFactory* host_factory);
35 ~PpapiHost();
36
37 // Sender implementation
38 virtual bool Send(IPC::Message* msg) OVERRIDE;
39
40 // Listener implementation
41 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
42
43 void SendReply(const proxy::ResourceMessageReplyParams& params,
44 const IPC::Message& msg);
45
46 private:
47 struct InstanceData;
48
49 // Message handlers.
50 void OnHostMsgResourceCall(const proxy::ResourceMessageCallParams& params,
51 const IPC::Message& nested_msg);
52 void OnHostMsgResourceCreated(const proxy::ResourceMessageCallParams& param,
53 PP_Instance instance,
54 const IPC::Message& nested_msg);
55 void OnHostMsgResourceDestroyed(PP_Resource resource);
56
57 // Returns null if the resource doesn't exist.
58 host::ResourceHost* GetResourceHost(PP_Resource resource);
59
60 // Non-owning pointer.
61 IPC::Message::Sender* sender_;
62
63 // Non-owning pointer.
64 HostFactory* host_factory_;
65
66 typedef std::map<PP_Resource, linked_ptr<ResourceHost> > ResourceMap;
67 ResourceMap resources_;
68
69 DISALLOW_COPY_AND_ASSIGN(PpapiHost);
70 };
71
72 } // namespace host
73 } // namespace ppapi
74
75 #endif // PPAPI_HOST_PPAPIE_HOST_H_
OLDNEW
« no previous file with comments | « ppapi/host/host_message_context.h ('k') | ppapi/host/ppapi_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698