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" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void ResetMainThreadMessageLoopForTesting(); | 108 void ResetMainThreadMessageLoopForTesting(); |
109 | 109 |
110 // Return the MessageLoopShared of the current thread, if any. This will | 110 // Return the MessageLoopShared of the current thread, if any. This will |
111 // always return NULL on the host side, where PPB_MessageLoop is not | 111 // always return NULL on the host side, where PPB_MessageLoop is not |
112 // supported. | 112 // supported. |
113 virtual MessageLoopShared* GetCurrentMessageLoop() = 0; | 113 virtual MessageLoopShared* GetCurrentMessageLoop() = 0; |
114 | 114 |
115 // Returns a task runner for file operations that may block. | 115 // Returns a task runner for file operations that may block. |
116 // TODO(bbudge) Move this to PluginGlobals when we no longer support | 116 // TODO(bbudge) Move this to PluginGlobals when we no longer support |
117 // in-process plugins. | 117 // in-process plugins. |
118 virtual base::TaskRunner* GetFileTaskRunner(PP_Instance instance) = 0; | 118 virtual base::TaskRunner* GetFileTaskRunner() = 0; |
119 | 119 |
120 // Returns the command line for the process. | 120 // Returns the command line for the process. |
121 virtual std::string GetCmdLine() = 0; | 121 virtual std::string GetCmdLine() = 0; |
122 | 122 |
123 // Preloads the font on Windows, does nothing on other platforms. | 123 // Preloads the font on Windows, does nothing on other platforms. |
124 // TODO(brettw) remove this by passing the instance into the API so we don't | 124 // TODO(brettw) remove this by passing the instance into the API so we don't |
125 // have to have it on the globals. | 125 // have to have it on the globals. |
126 virtual void PreCacheFontForFlash(const void* logfontw) = 0; | 126 virtual void PreCacheFontForFlash(const void* logfontw) = 0; |
127 | 127 |
128 virtual bool IsHostGlobals() const; | 128 virtual bool IsHostGlobals() const; |
129 virtual bool IsPluginGlobals() const; | 129 virtual bool IsPluginGlobals() const; |
130 | 130 |
131 private: | 131 private: |
132 // Return the thread-local pointer which is used only for unit testing. It | 132 // Return the thread-local pointer which is used only for unit testing. It |
133 // should always be NULL when running in production. It allows separate | 133 // should always be NULL when running in production. It allows separate |
134 // threads to have distinct "globals". | 134 // threads to have distinct "globals". |
135 static PpapiGlobals* GetThreadLocalPointer(); | 135 static PpapiGlobals* GetThreadLocalPointer(); |
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 |