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 #include "webkit/plugins/ppapi/host_globals.h" | 5 #include "webkit/plugins/ppapi/host_globals.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 } // namespace | 73 } // namespace |
74 | 74 |
75 HostGlobals* HostGlobals::host_globals_ = NULL; | 75 HostGlobals* HostGlobals::host_globals_ = NULL; |
76 | 76 |
77 HostGlobals::HostGlobals() : ::ppapi::PpapiGlobals() { | 77 HostGlobals::HostGlobals() : ::ppapi::PpapiGlobals() { |
78 DCHECK(!host_globals_); | 78 DCHECK(!host_globals_); |
79 host_globals_ = this; | 79 host_globals_ = this; |
80 } | 80 } |
81 | 81 |
82 HostGlobals::HostGlobals(::ppapi::PpapiGlobals::ForTest for_test) | 82 HostGlobals::HostGlobals( |
83 : ::ppapi::PpapiGlobals(for_test) { | 83 ::ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test) |
| 84 : ::ppapi::PpapiGlobals(per_thread_for_test) { |
84 DCHECK(!host_globals_); | 85 DCHECK(!host_globals_); |
85 } | 86 } |
86 | 87 |
87 HostGlobals::~HostGlobals() { | 88 HostGlobals::~HostGlobals() { |
88 DCHECK(host_globals_ == this || !host_globals_); | 89 DCHECK(host_globals_ == this || !host_globals_); |
89 host_globals_ = NULL; | 90 host_globals_ = NULL; |
90 } | 91 } |
91 | 92 |
92 ::ppapi::ResourceTracker* HostGlobals::GetResourceTracker() { | 93 ::ppapi::ResourceTracker* HostGlobals::GetResourceTracker() { |
93 return &resource_tracker_; | 94 return &resource_tracker_; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 return NULL; | 262 return NULL; |
262 return found->second; | 263 return found->second; |
263 } | 264 } |
264 | 265 |
265 bool HostGlobals::IsHostGlobals() const { | 266 bool HostGlobals::IsHostGlobals() const { |
266 return true; | 267 return true; |
267 } | 268 } |
268 | 269 |
269 } // namespace ppapi | 270 } // namespace ppapi |
270 } // namespace webkit | 271 } // namespace webkit |
OLD | NEW |