Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Side by Side Diff: ppapi/shared_impl/ppapi_globals.h

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix win & mac build Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/shared_impl/DEPS ('k') | ppapi/shared_impl/ppapi_globals.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <map>
8 #include <string> 9 #include <string>
10 #include <vector>
9 11
10 #include "base/basictypes.h" 12 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
12 #include "base/threading/thread_local.h" // For testing purposes only. 14 #include "base/threading/thread_local.h" // For testing purposes only.
13 #include "ppapi/c/pp_instance.h" 15 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_module.h" 16 #include "ppapi/c/pp_module.h"
15 #include "ppapi/c/ppb_console.h" 17 #include "ppapi/c/ppb_console.h"
16 #include "ppapi/shared_impl/api_id.h" 18 #include "ppapi/shared_impl/api_id.h"
17 #include "ppapi/shared_impl/ppapi_shared_export.h" 19 #include "ppapi/shared_impl/ppapi_shared_export.h"
20 #include "ui/events/latency_info.h"
18 21
19 namespace base { 22 namespace base {
20 class MessageLoopProxy; 23 class MessageLoopProxy;
21 class TaskRunner; 24 class TaskRunner;
22 } 25 }
23 26
24 namespace ppapi { 27 namespace ppapi {
25 28
26 class CallbackTracker; 29 class CallbackTracker;
27 class MessageLoopShared; 30 class MessageLoopShared;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 130
128 virtual bool IsHostGlobals() const; 131 virtual bool IsHostGlobals() const;
129 virtual bool IsPluginGlobals() const; 132 virtual bool IsPluginGlobals() const;
130 133
131 // Records that the plugin is active. The plugin reports that it is active to 134 // Records that the plugin is active. The plugin reports that it is active to
132 // containers that monitor and shutdown idle content such as background apps. 135 // containers that monitor and shutdown idle content such as background apps.
133 // This method only has an effect on the plugin process, calls from the 136 // This method only has an effect on the plugin process, calls from the
134 // renderer process will have no effect. 137 // renderer process will have no effect.
135 virtual void MarkPluginIsActive(); 138 virtual void MarkPluginIsActive();
136 139
140 // Caches an input event's |latency_info| for the plugin |instance|.
141 void AddLatencyInfo(const ui::LatencyInfo& latency_info,
142 PP_Instance instance);
143 // Transfers plugin |instance|'s latency info into |latency_info|.
144 void TransferLatencyInfoTo(std::vector<ui::LatencyInfo>* latency_info,
145 PP_Instance instance);
146
137 private: 147 private:
138 // Return the thread-local pointer which is used only for unit testing. It 148 // Return the thread-local pointer which is used only for unit testing. It
139 // should always be NULL when running in production. It allows separate 149 // should always be NULL when running in production. It allows separate
140 // threads to have distinct "globals". 150 // threads to have distinct "globals".
141 static PpapiGlobals* GetThreadLocalPointer(); 151 static PpapiGlobals* GetThreadLocalPointer();
142 152
143 scoped_refptr<base::MessageLoopProxy> main_loop_proxy_; 153 scoped_refptr<base::MessageLoopProxy> main_loop_proxy_;
144 154
155 // If an input event is believed to have caused rendering damage, its latency
156 // info is cached in |latency_info_for_frame_| indexed by instance. These
157 // latency info will be passed back to renderer with the next plugin frame.
158 std::map<PP_Instance, std::vector<ui::LatencyInfo> > latency_info_for_frame_;
159
145 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); 160 DISALLOW_COPY_AND_ASSIGN(PpapiGlobals);
146 }; 161 };
147 162
148 } // namespace ppapi 163 } // namespace ppapi
149 164
150 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ 165 #endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/DEPS ('k') | ppapi/shared_impl/ppapi_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698