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

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

Issue 10803050: Hook up the PPB_Flash_Print interface to new host system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
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_INSTANCE_MESSAGE_FILTER_H_
6 #define PPAPI_HOST_INSTANCE_MESSAGE_FILTER_H_
7
8 #include "base/basictypes.h"
9 #include "ppapi/host/ppapi_host_export.h"
10
11 namespace IPC {
12 class Message;
13 }
14
15 namespace ppapi {
16 namespace host {
17
18 class PpapiHost;
19
20 class PPAPI_HOST_EXPORT InstanceMessageFilter {
21 public:
22 // Invoked when the PpapiHost is being destroyed. Gives subclasses a chance
23 // to cleanup. At the time this is invoked, host() returns NULL. It is safe
24 // to |delete this| from this function.
25 virtual void PpapiHostDestroyed(PpapiHost* host) {}
26
27 // Processes an instance message from the plugin process. Returns true if the
28 // message was handled. On false, the PpapiHost will forward the message to
29 // the next filter.
30 virtual bool OnInstanceMessageReceived(const IPC::Message& msg) = 0;
31
32 // Will return NULL if the host is destroyed.
33 PpapiHost* host() { return host_; }
34
35 protected:
36 explicit InstanceMessageFilter(PpapiHost* host);
37 virtual ~InstanceMessageFilter();
38
39 private:
40 friend class PpapiHost;
41
42 // Invoked by PpapiHost when the host is destroyed. Nulls out host_ and calls
43 // PpapiHostDestroyed().
44 void CallPpapiHostDestroyed();
dmichael (off chromium) 2012/07/25 16:57:27 nit: Since it does a little more than call PpapiHo
45
46 PpapiHost* host_;
47
48 DISALLOW_COPY_AND_ASSIGN(InstanceMessageFilter);
49 };
50
51 } // namespace host
52 } // namespace ppapi
53
54 #endif // PPAPI_HOST_INSTANCE_MESSAGE_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698