OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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_PROXY_BROWSER_DISPATCHER_H_ |
| 6 #define PPAPI_PROXY_BROWSER_DISPATCHER_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/scoped_ptr.h" |
| 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/proxy/dispatcher.h" |
| 15 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 16 #include "ppapi/proxy/plugin_var_tracker.h" |
| 17 |
| 18 struct PPB_Var_Deprecated; |
| 19 |
| 20 namespace base { |
| 21 class WaitableEvent; |
| 22 } |
| 23 |
| 24 namespace IPC { |
| 25 class SyncChannel; |
| 26 } |
| 27 |
| 28 namespace pp { |
| 29 namespace proxy { |
| 30 |
| 31 class InterfaceProxy; |
| 32 class VarSerialization; |
| 33 |
| 34 class BrowserDispatcher : public Dispatcher { |
| 35 public: |
| 36 // Constructor for the renderer side. |
| 37 // |
| 38 // You must call Dispatcher::InitWithChannel after the constructor. |
| 39 BrowserDispatcher(const PPB_Var_Deprecated* var_interface, |
| 40 PP_Module module, |
| 41 GetInterfaceFunc local_get_interface); |
| 42 ~BrowserDispatcher(); |
| 43 |
| 44 // The browser side maintains a mapping from PP_Instance to Dispatcher so that |
| 45 // we can send the messages to the right channel. |
| 46 static BrowserDispatcher* GetForInstance(PP_Instance instance); |
| 47 static void SetForInstance(PP_Instance instance, |
| 48 BrowserDispatcher* dispatcher); |
| 49 static void RemoveForInstance(PP_Instance instance); |
| 50 |
| 51 // Dispatcher overrides. |
| 52 virtual bool IsPlugin() const { return false; } |
| 53 |
| 54 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(BrowserDispatcher); |
| 56 }; |
| 57 |
| 58 } // namespace proxy |
| 59 } // namespace pp |
| 60 |
| 61 #endif // PPAPI_PROXY_BROWSER_DISPATCHER_H_ |
OLD | NEW |