| 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/threading/thread_local.h" // For testing purposes only. | 12 #include "base/threading/thread_local.h" // For testing purposes only. |
| 12 #include "ppapi/c/dev/ppb_console_dev.h" | 13 #include "ppapi/c/dev/ppb_console_dev.h" |
| 13 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_module.h" | 15 #include "ppapi/c/pp_module.h" |
| 15 #include "ppapi/shared_impl/api_id.h" | 16 #include "ppapi/shared_impl/api_id.h" |
| 16 #include "ppapi/shared_impl/ppapi_shared_export.h" | 17 #include "ppapi/shared_impl/ppapi_shared_export.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class Lock; | 20 class Lock; |
| 20 class MessageLoopProxy; | 21 class MessageLoopProxy; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 virtual bool IsPluginGlobals() const; | 120 virtual bool IsPluginGlobals() const; |
| 120 | 121 |
| 121 private: | 122 private: |
| 122 // Return the thread-local pointer which is used only for unit testing. It | 123 // Return the thread-local pointer which is used only for unit testing. It |
| 123 // should always be NULL when running in production. It allows separate | 124 // should always be NULL when running in production. It allows separate |
| 124 // threads to have distinct "globals". | 125 // threads to have distinct "globals". |
| 125 static PpapiGlobals* GetThreadLocalPointer(); | 126 static PpapiGlobals* GetThreadLocalPointer(); |
| 126 | 127 |
| 127 static PpapiGlobals* ppapi_globals_; | 128 static PpapiGlobals* ppapi_globals_; |
| 128 | 129 |
| 130 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
| 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); | 132 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace ppapi | 135 } // namespace ppapi |
| 133 | 136 |
| 134 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ | 137 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
| OLD | NEW |