| 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_PROXY_PLUGIN_GLOBALS_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| 6 #define PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 6 #define PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 struct PP_BrowserFont_Trusted_Description; | 27 struct PP_BrowserFont_Trusted_Description; |
| 28 | 28 |
| 29 namespace ppapi { | 29 namespace ppapi { |
| 30 | 30 |
| 31 struct Preferences; | 31 struct Preferences; |
| 32 | 32 |
| 33 namespace proxy { | 33 namespace proxy { |
| 34 | 34 |
| 35 class MessageLoopResource; | 35 class MessageLoopResource; |
| 36 class PluginProxyDelegate; | 36 class PluginProxyDelegate; |
| 37 class ResourceReplyThreadRegistrar; |
| 37 | 38 |
| 38 class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals { | 39 class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals { |
| 39 public: | 40 public: |
| 40 PluginGlobals(); | 41 PluginGlobals(); |
| 41 explicit PluginGlobals(PpapiGlobals::PerThreadForTest); | 42 explicit PluginGlobals(PpapiGlobals::PerThreadForTest); |
| 42 virtual ~PluginGlobals(); | 43 virtual ~PluginGlobals(); |
| 43 | 44 |
| 44 // Getter for the global singleton. Generally, you should use | 45 // Getter for the global singleton. Generally, you should use |
| 45 // PpapiGlobals::Get() when possible. Use this only when you need some | 46 // PpapiGlobals::Get() when possible. Use this only when you need some |
| 46 // plugin-specific functionality. | 47 // plugin-specific functionality. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // long as the plugin. | 122 // long as the plugin. |
| 122 MessageLoopResource* loop_for_main_thread(); | 123 MessageLoopResource* loop_for_main_thread(); |
| 123 | 124 |
| 124 // The embedder should call this function when the name of the plugin module | 125 // The embedder should call this function when the name of the plugin module |
| 125 // is known. This will be used for error logging. | 126 // is known. This will be used for error logging. |
| 126 void set_plugin_name(const std::string& name) { plugin_name_ = name; } | 127 void set_plugin_name(const std::string& name) { plugin_name_ = name; } |
| 127 | 128 |
| 128 // The embedder should call this function when the command line is known. | 129 // The embedder should call this function when the command line is known. |
| 129 void set_command_line(const std::string& c) { command_line_ = c; } | 130 void set_command_line(const std::string& c) { command_line_ = c; } |
| 130 | 131 |
| 132 ResourceReplyThreadRegistrar* resource_reply_thread_registrar() { |
| 133 return resource_reply_thread_registrar_.get(); |
| 134 } |
| 135 |
| 131 private: | 136 private: |
| 132 class BrowserSender; | 137 class BrowserSender; |
| 133 | 138 |
| 134 // PpapiGlobals overrides. | 139 // PpapiGlobals overrides. |
| 135 virtual bool IsPluginGlobals() const OVERRIDE; | 140 virtual bool IsPluginGlobals() const OVERRIDE; |
| 136 | 141 |
| 137 static PluginGlobals* plugin_globals_; | 142 static PluginGlobals* plugin_globals_; |
| 138 | 143 |
| 139 PluginProxyDelegate* plugin_proxy_delegate_; | 144 PluginProxyDelegate* plugin_proxy_delegate_; |
| 140 PluginResourceTracker plugin_resource_tracker_; | 145 PluginResourceTracker plugin_resource_tracker_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 153 // Command line for the plugin. This will be empty until set_command_line is | 158 // Command line for the plugin. This will be empty until set_command_line is |
| 154 // called. | 159 // called. |
| 155 std::string command_line_; | 160 std::string command_line_; |
| 156 | 161 |
| 157 scoped_ptr<BrowserSender> browser_sender_; | 162 scoped_ptr<BrowserSender> browser_sender_; |
| 158 | 163 |
| 159 // Thread for performing potentially blocking file operations. It's created | 164 // Thread for performing potentially blocking file operations. It's created |
| 160 // lazily, since it might not be needed. | 165 // lazily, since it might not be needed. |
| 161 scoped_ptr<base::Thread> file_thread_; | 166 scoped_ptr<base::Thread> file_thread_; |
| 162 | 167 |
| 168 scoped_refptr<ResourceReplyThreadRegistrar> resource_reply_thread_registrar_; |
| 169 |
| 163 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); | 170 DISALLOW_COPY_AND_ASSIGN(PluginGlobals); |
| 164 }; | 171 }; |
| 165 | 172 |
| 166 } // namespace proxy | 173 } // namespace proxy |
| 167 } // namespace ppapi | 174 } // namespace ppapi |
| 168 | 175 |
| 169 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ | 176 #endif // PPAPI_PROXY_PLUGIN_GLOBALS_H_ |
| OLD | NEW |