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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.h

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: change PP_instance to InstanceHandle in StartTrackingLatency 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
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 CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "ppapi/thunk/ppb_gamepad_api.h" 48 #include "ppapi/thunk/ppb_gamepad_api.h"
49 #include "ppapi/thunk/resource_creation_api.h" 49 #include "ppapi/thunk/resource_creation_api.h"
50 #include "skia/ext/refptr.h" 50 #include "skia/ext/refptr.h"
51 #include "third_party/WebKit/public/platform/WebCanvas.h" 51 #include "third_party/WebKit/public/platform/WebCanvas.h"
52 #include "third_party/WebKit/public/platform/WebString.h" 52 #include "third_party/WebKit/public/platform/WebString.h"
53 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" 53 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
54 #include "third_party/WebKit/public/platform/WebURLResponse.h" 54 #include "third_party/WebKit/public/platform/WebURLResponse.h"
55 #include "third_party/WebKit/public/web/WebPlugin.h" 55 #include "third_party/WebKit/public/web/WebPlugin.h"
56 #include "third_party/WebKit/public/web/WebUserGestureToken.h" 56 #include "third_party/WebKit/public/web/WebUserGestureToken.h"
57 #include "ui/base/ime/text_input_type.h" 57 #include "ui/base/ime/text_input_type.h"
58 #include "ui/events/latency_info.h"
58 #include "ui/gfx/rect.h" 59 #include "ui/gfx/rect.h"
59 #include "url/gurl.h" 60 #include "url/gurl.h"
60 61
61 struct PP_Point; 62 struct PP_Point;
62 struct _NPP; 63 struct _NPP;
63 64
64 class SkBitmap; 65 class SkBitmap;
65 class TransportDIB; 66 class TransportDIB;
66 67
67 namespace blink { 68 namespace blink {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE; 396 virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size) OVERRIDE;
396 virtual ppapi::Resource* GetSingletonResource(PP_Instance instance, 397 virtual ppapi::Resource* GetSingletonResource(PP_Instance instance,
397 ppapi::SingletonResourceID id) 398 ppapi::SingletonResourceID id)
398 OVERRIDE; 399 OVERRIDE;
399 virtual int32_t RequestInputEvents(PP_Instance instance, 400 virtual int32_t RequestInputEvents(PP_Instance instance,
400 uint32_t event_classes) OVERRIDE; 401 uint32_t event_classes) OVERRIDE;
401 virtual int32_t RequestFilteringInputEvents(PP_Instance instance, 402 virtual int32_t RequestFilteringInputEvents(PP_Instance instance,
402 uint32_t event_classes) OVERRIDE; 403 uint32_t event_classes) OVERRIDE;
403 virtual void ClearInputEventRequest(PP_Instance instance, 404 virtual void ClearInputEventRequest(PP_Instance instance,
404 uint32_t event_classes) OVERRIDE; 405 uint32_t event_classes) OVERRIDE;
406 virtual void StartTrackingLatency(PP_Instance instance) OVERRIDE;
405 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE; 407 virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE;
406 virtual void ZoomLimitsChanged(PP_Instance instance, 408 virtual void ZoomLimitsChanged(PP_Instance instance,
407 double minimum_factor, 409 double minimum_factor,
408 double maximum_factor) OVERRIDE; 410 double maximum_factor) OVERRIDE;
409 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; 411 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE;
410 virtual PP_Bool SetCursor(PP_Instance instance, 412 virtual PP_Bool SetCursor(PP_Instance instance,
411 PP_MouseCursor_Type type, 413 PP_MouseCursor_Type type,
412 PP_Resource image, 414 PP_Resource image,
413 const PP_Point* hot_spot) OVERRIDE; 415 const PP_Point* hot_spot) OVERRIDE;
414 virtual int32_t LockMouse(PP_Instance instance, 416 virtual int32_t LockMouse(PP_Instance instance,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 500
499 // cc::TextureLayerClient implementation. 501 // cc::TextureLayerClient implementation.
500 virtual bool PrepareTextureMailbox( 502 virtual bool PrepareTextureMailbox(
501 cc::TextureMailbox* mailbox, 503 cc::TextureMailbox* mailbox,
502 scoped_ptr<cc::SingleReleaseCallback>* release_callback, 504 scoped_ptr<cc::SingleReleaseCallback>* release_callback,
503 bool use_shared_memory) OVERRIDE; 505 bool use_shared_memory) OVERRIDE;
504 506
505 // RenderFrameObserver 507 // RenderFrameObserver
506 virtual void OnDestruct() OVERRIDE; 508 virtual void OnDestruct() OVERRIDE;
507 509
510 void AddLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
511
508 private: 512 private:
509 friend class base::RefCounted<PepperPluginInstanceImpl>; 513 friend class base::RefCounted<PepperPluginInstanceImpl>;
510 friend class PpapiUnittest; 514 friend class PpapiUnittest;
511 515
512 // Delete should be called by the WebPlugin before this destructor. 516 // Delete should be called by the WebPlugin before this destructor.
513 virtual ~PepperPluginInstanceImpl(); 517 virtual ~PepperPluginInstanceImpl();
514 518
515 // Class to record document load notifications and play them back once the 519 // Class to record document load notifications and play them back once the
516 // real document loader becomes available. Used only by external instances. 520 // real document loader becomes available. Used only by external instances.
517 class ExternalDocumentLoader : public blink::WebURLLoaderClient { 521 class ExternalDocumentLoader : public blink::WebURLLoaderClient {
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 // Isolate in which this Instance was created when interacting with v8. 859 // Isolate in which this Instance was created when interacting with v8.
856 v8::Isolate* isolate_; 860 v8::Isolate* isolate_;
857 861
858 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; 862 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_;
859 863
860 bool is_deleted_; 864 bool is_deleted_;
861 865
862 // The text that is currently selected in the plugin. 866 // The text that is currently selected in the plugin.
863 base::string16 selected_text_; 867 base::string16 selected_text_;
864 868
869 int64 last_input_number_;
870
871 bool is_tracking_latency_;
872
865 // We use a weak ptr factory for scheduling DidChangeView events so that we 873 // We use a weak ptr factory for scheduling DidChangeView events so that we
866 // can tell whether updates are pending and consolidate them. When there's 874 // can tell whether updates are pending and consolidate them. When there's
867 // already a weak ptr pending (HasWeakPtrs is true), code should update the 875 // already a weak ptr pending (HasWeakPtrs is true), code should update the
868 // view_data_ but not send updates. This also allows us to cancel scheduled 876 // view_data_ but not send updates. This also allows us to cancel scheduled
869 // view change events. 877 // view change events.
870 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; 878 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_;
871 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; 879 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_;
872 880
873 friend class PpapiPluginInstanceTest; 881 friend class PpapiPluginInstanceTest;
874 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); 882 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl);
875 }; 883 };
876 884
877 } // namespace content 885 } // namespace content
878 886
879 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 887 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698