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/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_module.h" | 14 #include "ppapi/c/pp_module.h" |
15 #include "ppapi/c/ppb_console.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; | |
21 class MessageLoopProxy; | 20 class MessageLoopProxy; |
22 class TaskRunner; | 21 class TaskRunner; |
23 } | 22 } |
24 | 23 |
25 namespace ppapi { | 24 namespace ppapi { |
26 | 25 |
27 class CallbackTracker; | 26 class CallbackTracker; |
28 class MessageLoopShared; | 27 class MessageLoopShared; |
29 class ResourceTracker; | 28 class ResourceTracker; |
30 class VarTracker; | 29 class VarTracker; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // PpapiGlobals object must have been constructed using the "PerThreadForTest" | 61 // PpapiGlobals object must have been constructed using the "PerThreadForTest" |
63 // parameter. | 62 // parameter. |
64 static void SetPpapiGlobalsOnThreadForTest(PpapiGlobals* ptr); | 63 static void SetPpapiGlobalsOnThreadForTest(PpapiGlobals* ptr); |
65 | 64 |
66 // Retrieves the corresponding tracker. | 65 // Retrieves the corresponding tracker. |
67 virtual ResourceTracker* GetResourceTracker() = 0; | 66 virtual ResourceTracker* GetResourceTracker() = 0; |
68 virtual VarTracker* GetVarTracker() = 0; | 67 virtual VarTracker* GetVarTracker() = 0; |
69 virtual CallbackTracker* GetCallbackTrackerForInstance( | 68 virtual CallbackTracker* GetCallbackTrackerForInstance( |
70 PP_Instance instance) = 0; | 69 PP_Instance instance) = 0; |
71 | 70 |
72 virtual base::Lock* GetProxyLock() = 0; | |
73 | |
74 // Logs the given string to the JS console. If "source" is empty, the name of | 71 // Logs the given string to the JS console. If "source" is empty, the name of |
75 // the current module will be used, if it can be determined. | 72 // the current module will be used, if it can be determined. |
76 virtual void LogWithSource(PP_Instance instance, | 73 virtual void LogWithSource(PP_Instance instance, |
77 PP_LogLevel level, | 74 PP_LogLevel level, |
78 const std::string& source, | 75 const std::string& source, |
79 const std::string& value) = 0; | 76 const std::string& value) = 0; |
80 | 77 |
81 // Like LogWithSource but broadcasts the log to all instances of the given | 78 // Like LogWithSource but broadcasts the log to all instances of the given |
82 // module. The module may be 0 to specify that all consoles possibly | 79 // module. The module may be 0 to specify that all consoles possibly |
83 // associated with the calling code should be notified. This allows us to | 80 // associated with the calling code should be notified. This allows us to |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 static PpapiGlobals* GetThreadLocalPointer(); | 135 static PpapiGlobals* GetThreadLocalPointer(); |
139 | 136 |
140 scoped_refptr<base::MessageLoopProxy> main_loop_proxy_; | 137 scoped_refptr<base::MessageLoopProxy> main_loop_proxy_; |
141 | 138 |
142 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); | 139 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); |
143 }; | 140 }; |
144 | 141 |
145 } // namespace ppapi | 142 } // namespace ppapi |
146 | 143 |
147 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 144 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
OLD | NEW |