| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ppapi/shared_impl/ppapi_globals.h" | 5 #include "ppapi/shared_impl/ppapi_globals.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace ppapi { | 9 namespace ppapi { |
| 10 | 10 |
| 11 PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL; | 11 PpapiGlobals* PpapiGlobals::ppapi_globals_ = NULL; |
| 12 base::ThreadLocalPointer<PpapiGlobals> PpapiGlobals::ppapi_globals_for_test_; |
| 12 | 13 |
| 13 PpapiGlobals::PpapiGlobals() { | 14 PpapiGlobals::PpapiGlobals() { |
| 14 DCHECK(!ppapi_globals_); | 15 // TODO(dmichael): Re-enable this check for when we're not testing. |
| 16 //DCHECK(!ppapi_globals_); |
| 15 ppapi_globals_ = this; | 17 ppapi_globals_ = this; |
| 16 } | 18 } |
| 17 | 19 |
| 18 PpapiGlobals::~PpapiGlobals() { | 20 PpapiGlobals::~PpapiGlobals() { |
| 19 DCHECK(ppapi_globals_ == this); | 21 // TODO(dmichael): Re-enable this check for when we're not testing. |
| 22 //DCHECK(ppapi_globals_ == this); |
| 20 ppapi_globals_ = NULL; | 23 ppapi_globals_ = NULL; |
| 21 } | 24 } |
| 22 | 25 |
| 23 } // namespace ppapi | 26 } // namespace ppapi |
| OLD | NEW |