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 PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
6 #define PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 6 #define PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/threading/thread_local.h" // For testing purposes only. | 12 #include "base/threading/thread_local.h" // For testing purposes only. |
13 #include "ppapi/c/dev/ppb_console_dev.h" | |
14 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_module.h" | 14 #include "ppapi/c/pp_module.h" |
| 15 #include "ppapi/c/ppb_console.h" |
16 #include "ppapi/shared_impl/api_id.h" | 16 #include "ppapi/shared_impl/api_id.h" |
17 #include "ppapi/shared_impl/ppapi_shared_export.h" | 17 #include "ppapi/shared_impl/ppapi_shared_export.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class Lock; | 20 class Lock; |
21 class MessageLoopProxy; | 21 class MessageLoopProxy; |
22 } | 22 } |
23 | 23 |
24 namespace ppapi { | 24 namespace ppapi { |
25 | 25 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual ResourceTracker* GetResourceTracker() = 0; | 72 virtual ResourceTracker* GetResourceTracker() = 0; |
73 virtual VarTracker* GetVarTracker() = 0; | 73 virtual VarTracker* GetVarTracker() = 0; |
74 virtual CallbackTracker* GetCallbackTrackerForInstance( | 74 virtual CallbackTracker* GetCallbackTrackerForInstance( |
75 PP_Instance instance) = 0; | 75 PP_Instance instance) = 0; |
76 | 76 |
77 virtual base::Lock* GetProxyLock() = 0; | 77 virtual base::Lock* GetProxyLock() = 0; |
78 | 78 |
79 // Logs the given string to the JS console. If "source" is empty, the name of | 79 // Logs the given string to the JS console. If "source" is empty, the name of |
80 // the current module will be used, if it can be determined. | 80 // the current module will be used, if it can be determined. |
81 virtual void LogWithSource(PP_Instance instance, | 81 virtual void LogWithSource(PP_Instance instance, |
82 PP_LogLevel_Dev level, | 82 PP_LogLevel level, |
83 const std::string& source, | 83 const std::string& source, |
84 const std::string& value) = 0; | 84 const std::string& value) = 0; |
85 | 85 |
86 // Like LogWithSource but broadcasts the log to all instances of the given | 86 // Like LogWithSource but broadcasts the log to all instances of the given |
87 // module. The module may be 0 to specify that all consoles possibly | 87 // module. The module may be 0 to specify that all consoles possibly |
88 // associated with the calling code should be notified. This allows us to | 88 // associated with the calling code should be notified. This allows us to |
89 // log errors for things like bad resource IDs where we may not have an | 89 // log errors for things like bad resource IDs where we may not have an |
90 // associated instance. | 90 // associated instance. |
91 // | 91 // |
92 // Note that in the plugin process, the module parameter is ignored since | 92 // Note that in the plugin process, the module parameter is ignored since |
93 // there is only one possible one. | 93 // there is only one possible one. |
94 virtual void BroadcastLogWithSource(PP_Module module, | 94 virtual void BroadcastLogWithSource(PP_Module module, |
95 PP_LogLevel_Dev level, | 95 PP_LogLevel level, |
96 const std::string& source, | 96 const std::string& source, |
97 const std::string& value) = 0; | 97 const std::string& value) = 0; |
98 | 98 |
99 // Returns the given API object associated with the given instance, or NULL | 99 // Returns the given API object associated with the given instance, or NULL |
100 // if the instance is invalid. | 100 // if the instance is invalid. |
101 virtual thunk::PPB_Instance_API* GetInstanceAPI(PP_Instance instance) = 0; | 101 virtual thunk::PPB_Instance_API* GetInstanceAPI(PP_Instance instance) = 0; |
102 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI( | 102 virtual thunk::ResourceCreationAPI* GetResourceCreationAPI( |
103 PP_Instance instance) = 0; | 103 PP_Instance instance) = 0; |
104 | 104 |
105 // Returns the PP_Module associated with the given PP_Instance, or 0 on | 105 // Returns the PP_Module associated with the given PP_Instance, or 0 on |
(...skipping 29 matching lines...) Expand all Loading... |
135 static PpapiGlobals* ppapi_globals_; | 135 static PpapiGlobals* ppapi_globals_; |
136 | 136 |
137 scoped_refptr<base::MessageLoopProxy> main_loop_proxy_; | 137 scoped_refptr<base::MessageLoopProxy> main_loop_proxy_; |
138 | 138 |
139 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); | 139 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); |
140 }; | 140 }; |
141 | 141 |
142 } // namespace ppapi | 142 } // namespace ppapi |
143 | 143 |
144 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 144 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
OLD | NEW |