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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10875077: Add UMA histogram to determine how often Stage3D could be used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/ppapi_preferences.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 36569266fbcc26a230ea6c32eafaa6ab587505c1..e81c614977bea07d7bc0ab192d107d34d8c682e9 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -29,6 +29,7 @@
#include "ppapi/c/ppp_mouse_lock.h"
#include "ppapi/c/private/pp_content_decryptor.h"
#include "ppapi/c/private/ppp_instance_private.h"
+#include "ppapi/shared_impl/ppapi_preferences.h"
#include "ppapi/shared_impl/ppb_input_event_shared.h"
#include "ppapi/shared_impl/ppb_url_util_shared.h"
#include "ppapi/shared_impl/ppb_view_shared.h"
@@ -96,6 +97,7 @@
#if defined(OS_WIN)
#include "base/metrics/histogram.h"
+#include "base/win/windows_version.h"
#include "skia/ext/platform_canvas.h"
#include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/gdi_util.h"
@@ -544,6 +546,23 @@ bool PluginInstance::Initialize(WebPluginContainer* container,
container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents());
+#if defined(OS_WIN)
brettw 2012/08/27 22:19:28 Can you split this into a separate function?
+ if (base::win::GetVersion() <= base::win::VERSION_XP) {
+ ::ppapi::Preferences prefs = delegate_->GetPreferences();
+ bool needsgpu = false;
vangelis 2012/08/28 05:12:06 nit: according to chrome's variable naming convent
+
+ for (unsigned int i = 0; i < arg_names.size(); i++) {
brettw 2012/08/27 22:19:28 Use size_t since that's the type that vector.size(
+ if (arg_names[i] == "wmode") {
+ if (arg_values[i] == "direct" || arg_values[i] == "gpu")
+ needsgpu = true;
+ break;
+ }
+ }
+ UMA_HISTOGRAM_ENUMERATION("Flash.UsesGPU",
brettw 2012/08/27 22:19:28 Can you add a comment here about what this histogr
+ needsgpu * 2 + prefs.is_webgl_supported, 4);
vangelis 2012/08/28 05:12:06 Is this bool to int conversion pretty standard and
+ }
+#endif
+
argn_ = arg_names;
argv_ = arg_values;
scoped_array<const char*> argn_array(StringVectorToArgArray(argn_));
« no previous file with comments | « ppapi/shared_impl/ppapi_preferences.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698