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 "ppapi/shared_impl/ppapi_globals.h" | 5 #include "ppapi/shared_impl/ppapi_globals.h" |
6 | 6 |
7 #include "base/lazy_instance.h" // For testing purposes only. | 7 #include "base/lazy_instance.h" // For testing purposes only. |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/threading/thread_local.h" // For testing purposes only. | 10 #include "base/threading/thread_local.h" // For testing purposes only. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void PpapiGlobals::ResetMainThreadMessageLoopForTesting() { | 60 void PpapiGlobals::ResetMainThreadMessageLoopForTesting() { |
61 main_loop_proxy_ = base::MessageLoopProxy::current(); | 61 main_loop_proxy_ = base::MessageLoopProxy::current(); |
62 } | 62 } |
63 | 63 |
64 bool PpapiGlobals::IsHostGlobals() const { return false; } | 64 bool PpapiGlobals::IsHostGlobals() const { return false; } |
65 | 65 |
66 bool PpapiGlobals::IsPluginGlobals() const { return false; } | 66 bool PpapiGlobals::IsPluginGlobals() const { return false; } |
67 | 67 |
68 void PpapiGlobals::MarkPluginIsActive() {} | 68 void PpapiGlobals::MarkPluginIsActive() {} |
69 | 69 |
| 70 void PpapiGlobals::AddLatencyInfo(const ui::LatencyInfo& latency_info, |
| 71 PP_Instance instance) { |
| 72 latency_info_for_frame_[instance].push_back(latency_info); |
| 73 } |
| 74 |
| 75 void PpapiGlobals::TransferLatencyInfoTo( |
| 76 std::vector<ui::LatencyInfo>* latency_info, PP_Instance instance) { |
| 77 latency_info->swap(latency_info_for_frame_[instance]); |
| 78 latency_info_for_frame_.erase(instance); |
| 79 } |
| 80 |
70 // static | 81 // static |
71 PpapiGlobals* PpapiGlobals::GetThreadLocalPointer() { | 82 PpapiGlobals* PpapiGlobals::GetThreadLocalPointer() { |
72 return tls_ppapi_globals_for_test.Pointer()->Get(); | 83 return tls_ppapi_globals_for_test.Pointer()->Get(); |
73 } | 84 } |
74 | 85 |
75 } // namespace ppapi | 86 } // namespace ppapi |
OLD | NEW |