| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 WEBKIT_PLUGINS_PPAPI_HOST_VAR_TRACKER_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_HOST_VAR_TRACKER_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_HOST_VAR_TRACKER_H_ | 6 #define CONTENT_RENDERER_PEPPER_HOST_VAR_TRACKER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "content/common/content_export.h" |
| 16 #include "ppapi/c/pp_instance.h" | 17 #include "ppapi/c/pp_instance.h" |
| 17 #include "ppapi/shared_impl/host_resource.h" | 18 #include "ppapi/shared_impl/host_resource.h" |
| 18 #include "ppapi/shared_impl/resource_tracker.h" | 19 #include "ppapi/shared_impl/resource_tracker.h" |
| 19 #include "ppapi/shared_impl/var_tracker.h" | 20 #include "ppapi/shared_impl/var_tracker.h" |
| 20 #include "webkit/plugins/webkit_plugins_export.h" | |
| 21 | 21 |
| 22 typedef struct NPObject NPObject; | 22 typedef struct NPObject NPObject; |
| 23 | 23 |
| 24 namespace ppapi { | 24 namespace ppapi { |
| 25 class ArrayBufferVar; | 25 class ArrayBufferVar; |
| 26 class NPObjectVar; | 26 class NPObjectVar; |
| 27 class Var; | 27 class Var; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace webkit { | 30 namespace webkit { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 45 void RemoveNPObjectVar(::ppapi::NPObjectVar* object_var); | 45 void RemoveNPObjectVar(::ppapi::NPObjectVar* object_var); |
| 46 | 46 |
| 47 // Looks up a previously registered NPObjectVar for the given NPObject and | 47 // Looks up a previously registered NPObjectVar for the given NPObject and |
| 48 // instance. Returns NULL if there is no NPObjectVar corresponding to the | 48 // instance. Returns NULL if there is no NPObjectVar corresponding to the |
| 49 // given NPObject for the given instance. See AddNPObjectVar above. | 49 // given NPObject for the given instance. See AddNPObjectVar above. |
| 50 ::ppapi::NPObjectVar* NPObjectVarForNPObject(PP_Instance instance, | 50 ::ppapi::NPObjectVar* NPObjectVarForNPObject(PP_Instance instance, |
| 51 NPObject* np_object); | 51 NPObject* np_object); |
| 52 | 52 |
| 53 // Returns the number of NPObjectVar's associated with the given instance. | 53 // Returns the number of NPObjectVar's associated with the given instance. |
| 54 // Returns 0 if the instance isn't known. | 54 // Returns 0 if the instance isn't known. |
| 55 WEBKIT_PLUGINS_EXPORT int GetLiveNPObjectVarsForInstance( | 55 CONTENT_EXPORT int GetLiveNPObjectVarsForInstance( |
| 56 PP_Instance instance) const; | 56 PP_Instance instance) const; |
| 57 | 57 |
| 58 // VarTracker public implementation. | 58 // VarTracker public implementation. |
| 59 virtual void DidDeleteInstance(PP_Instance instance) OVERRIDE; | 59 virtual void DidDeleteInstance(PP_Instance instance) OVERRIDE; |
| 60 | 60 |
| 61 virtual int TrackSharedMemoryHandle(PP_Instance instance, | 61 virtual int TrackSharedMemoryHandle(PP_Instance instance, |
| 62 base::SharedMemoryHandle file, | 62 base::SharedMemoryHandle file, |
| 63 uint32 size_in_bytes) OVERRIDE; | 63 uint32 size_in_bytes) OVERRIDE; |
| 64 virtual bool StopTrackingSharedMemoryHandle(int id, | 64 virtual bool StopTrackingSharedMemoryHandle(int id, |
| 65 PP_Instance instance, | 65 PP_Instance instance, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 typedef std::map<int, SharedMemoryMapEntry> SharedMemoryMap; | 100 typedef std::map<int, SharedMemoryMapEntry> SharedMemoryMap; |
| 101 SharedMemoryMap shared_memory_map_; | 101 SharedMemoryMap shared_memory_map_; |
| 102 uint32_t last_shared_memory_map_id_; | 102 uint32_t last_shared_memory_map_id_; |
| 103 | 103 |
| 104 DISALLOW_COPY_AND_ASSIGN(HostVarTracker); | 104 DISALLOW_COPY_AND_ASSIGN(HostVarTracker); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace ppapi | 107 } // namespace ppapi |
| 108 } // namespace webkit | 108 } // namespace webkit |
| 109 | 109 |
| 110 #endif // WEBKIT_PLUGINS_PPAPI_HOST_VAR_TRACKER_H_ | 110 #endif // CONTENT_RENDERER_PEPPER_HOST_VAR_TRACKER_H_ |
| OLD | NEW |