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 CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_ |
6 #define CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_ | 6 #define CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "content/renderer/pepper/host_var_tracker.h" | 9 #include "content/renderer/pepper/host_var_tracker.h" |
10 #include "ppapi/shared_impl/callback_tracker.h" | 10 #include "ppapi/shared_impl/callback_tracker.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 inline static HostGlobals* Get() { | 28 inline static HostGlobals* Get() { |
29 DCHECK(PpapiGlobals::Get()->IsHostGlobals()); | 29 DCHECK(PpapiGlobals::Get()->IsHostGlobals()); |
30 return static_cast<HostGlobals*>(PpapiGlobals::Get()); | 30 return static_cast<HostGlobals*>(PpapiGlobals::Get()); |
31 } | 31 } |
32 | 32 |
33 // PpapiGlobals implementation. | 33 // PpapiGlobals implementation. |
34 virtual ppapi::ResourceTracker* GetResourceTracker() OVERRIDE; | 34 virtual ppapi::ResourceTracker* GetResourceTracker() OVERRIDE; |
35 virtual ppapi::VarTracker* GetVarTracker() OVERRIDE; | 35 virtual ppapi::VarTracker* GetVarTracker() OVERRIDE; |
36 virtual ppapi::CallbackTracker* GetCallbackTrackerForInstance( | 36 virtual ppapi::CallbackTracker* GetCallbackTrackerForInstance( |
37 PP_Instance instance) OVERRIDE; | 37 PP_Instance instance) OVERRIDE; |
38 virtual ppapi::thunk::PPB_Instance_API* GetInstanceAPI( | 38 virtual ppapi::thunk::PPB_Instance_API* GetInstanceAPI(PP_Instance instance) |
39 PP_Instance instance) OVERRIDE; | 39 OVERRIDE; |
40 virtual ppapi::thunk::ResourceCreationAPI* GetResourceCreationAPI( | 40 virtual ppapi::thunk::ResourceCreationAPI* GetResourceCreationAPI( |
41 PP_Instance instance) OVERRIDE; | 41 PP_Instance instance) OVERRIDE; |
42 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; | 42 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE; |
43 virtual std::string GetCmdLine() OVERRIDE; | 43 virtual std::string GetCmdLine() OVERRIDE; |
44 virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE; | 44 virtual void PreCacheFontForFlash(const void* logfontw) OVERRIDE; |
45 virtual void LogWithSource(PP_Instance instance, | 45 virtual void LogWithSource(PP_Instance instance, |
46 PP_LogLevel level, | 46 PP_LogLevel level, |
47 const std::string& source, | 47 const std::string& source, |
48 const std::string& value) OVERRIDE; | 48 const std::string& value) OVERRIDE; |
49 virtual void BroadcastLogWithSource(PP_Module module, | 49 virtual void BroadcastLogWithSource(PP_Module module, |
50 PP_LogLevel level, | 50 PP_LogLevel level, |
51 const std::string& source, | 51 const std::string& source, |
52 const std::string& value) OVERRIDE; | 52 const std::string& value) OVERRIDE; |
53 virtual ppapi::MessageLoopShared* GetCurrentMessageLoop() OVERRIDE; | 53 virtual ppapi::MessageLoopShared* GetCurrentMessageLoop() OVERRIDE; |
54 virtual base::TaskRunner* GetFileTaskRunner() OVERRIDE; | 54 virtual base::TaskRunner* GetFileTaskRunner() OVERRIDE; |
55 | 55 |
56 HostVarTracker* host_var_tracker() { | 56 HostVarTracker* host_var_tracker() { return &host_var_tracker_; } |
57 return &host_var_tracker_; | |
58 } | |
59 | 57 |
60 // PP_Modules ---------------------------------------------------------------- | 58 // PP_Modules ---------------------------------------------------------------- |
61 | 59 |
62 // Adds a new plugin module to the list of tracked module, and returns a new | 60 // Adds a new plugin module to the list of tracked module, and returns a new |
63 // module handle to identify it. | 61 // module handle to identify it. |
64 PP_Module AddModule(PluginModule* module); | 62 PP_Module AddModule(PluginModule* module); |
65 | 63 |
66 // Called when a plugin modulde was deleted and should no longer be tracked. | 64 // Called when a plugin modulde was deleted and should no longer be tracked. |
67 // The given handle should be one generated by AddModule. | 65 // The given handle should be one generated by AddModule. |
68 void ModuleDeleted(PP_Module module); | 66 void ModuleDeleted(PP_Module module); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Tracks all live modules. The pointers are non-owning, the PluginModule | 102 // Tracks all live modules. The pointers are non-owning, the PluginModule |
105 // destructor will notify us when the module is deleted. | 103 // destructor will notify us when the module is deleted. |
106 typedef std::map<PP_Module, PluginModule*> ModuleMap; | 104 typedef std::map<PP_Module, PluginModule*> ModuleMap; |
107 ModuleMap module_map_; | 105 ModuleMap module_map_; |
108 | 106 |
109 DISALLOW_COPY_AND_ASSIGN(HostGlobals); | 107 DISALLOW_COPY_AND_ASSIGN(HostGlobals); |
110 }; | 108 }; |
111 | 109 |
112 } // namespace content | 110 } // namespace content |
113 | 111 |
114 #endif // CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_ | 112 #endif // CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_ |
OLD | NEW |