OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef O3D_GPU_PLUGIN_NP_UTILS_NP_BROWSER_H_ | 5 #ifndef O3D_GPU_PLUGIN_NP_UTILS_NP_BROWSER_H_ |
6 #define O3D_GPU_PLUGIN_NP_UTILS_NP_BROWSER_H_ | 6 #define O3D_GPU_PLUGIN_NP_UTILS_NP_BROWSER_H_ |
7 | 7 |
8 #include "third_party/npapi/bindings/npapi.h" | 8 #include "third_party/npapi/bindings/npapi.h" |
9 #include "third_party/npapi/bindings/npruntime.h" | 9 #include "third_party/npapi/bindings/npruntime.h" |
10 | 10 |
11 typedef struct _NPNetscapeFuncs NPNetscapeFuncs; | 11 typedef struct _NPNetscapeFuncs NPNetscapeFuncs; |
12 typedef struct _NPChromiumFuncs NPChromiumFuncs; | |
13 | 12 |
14 namespace o3d { | 13 namespace o3d { |
15 namespace gpu_plugin { | 14 namespace gpu_plugin { |
16 | 15 |
17 // This class exposes the functions provided by the browser to a plugin (the | 16 // This class exposes the functions provided by the browser to a plugin (the |
18 // ones prefixed NPN_). | 17 // ones prefixed NPN_). |
19 class NPBrowser { | 18 class NPBrowser { |
20 public: | 19 public: |
21 explicit NPBrowser(NPNetscapeFuncs* funcs); | 20 explicit NPBrowser(NPNetscapeFuncs* funcs); |
22 virtual ~NPBrowser(); | 21 virtual ~NPBrowser(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 64 |
66 virtual bool Invoke(NPP npp, | 65 virtual bool Invoke(NPP npp, |
67 NPObject* object, | 66 NPObject* object, |
68 NPIdentifier name, | 67 NPIdentifier name, |
69 const NPVariant* args, | 68 const NPVariant* args, |
70 uint32_t num_args, | 69 uint32_t num_args, |
71 NPVariant* result); | 70 NPVariant* result); |
72 | 71 |
73 virtual NPObject* GetWindowNPObject(NPP npp); | 72 virtual NPObject* GetWindowNPObject(NPP npp); |
74 | 73 |
75 // Chromium specific additions. | |
76 virtual NPSharedMemory* MapSharedMemory(NPP id, | |
77 NPObject* object, | |
78 size_t size, | |
79 bool read_only); | |
80 | |
81 virtual void UnmapSharedMemory(NPP id, | |
82 NPSharedMemory* shared_memory); | |
83 | |
84 private: | 74 private: |
85 static NPBrowser* browser_; | 75 static NPBrowser* browser_; |
86 NPBrowser* previous_browser_; | 76 NPBrowser* previous_browser_; |
87 NPNetscapeFuncs* netscape_funcs_; | 77 NPNetscapeFuncs* netscape_funcs_; |
88 NPChromiumFuncs* chromium_funcs_; | |
89 DISALLOW_COPY_AND_ASSIGN(NPBrowser); | 78 DISALLOW_COPY_AND_ASSIGN(NPBrowser); |
90 }; | 79 }; |
91 | 80 |
92 } // namespace gpu_plugin | 81 } // namespace gpu_plugin |
93 } // namespace o3d | 82 } // namespace o3d |
94 | 83 |
95 #endif // O3D_GPU_PLUGIN_NP_UTILS_NP_BROWSER_H_ | 84 #endif // O3D_GPU_PLUGIN_NP_UTILS_NP_BROWSER_H_ |
OLD | NEW |