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

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

Issue 7402002: Move --disable-3d-apis check into resource creation so GetInterface() doesn't crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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 | « webkit/plugins/ppapi/resource_creation_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/resource_creation_impl.cc
diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc
index 37c096ae14107a59bd6a944c6d9a0b76faff1613..fd383977c2792fee3b8333826a03d50c6850f153 100644
--- a/webkit/plugins/ppapi/resource_creation_impl.cc
+++ b/webkit/plugins/ppapi/resource_creation_impl.cc
@@ -4,6 +4,7 @@
#include "webkit/plugins/ppapi/resource_creation_impl.h"
+#include "base/command_line.h"
#include "ppapi/c/pp_size.h"
#include "webkit/plugins/ppapi/common.h"
#include "webkit/plugins/ppapi/ppb_audio_impl.h"
@@ -57,7 +58,9 @@ PP_Resource ReturnResource(Resource* resource) {
ResourceCreationImpl::ResourceCreationImpl(PluginInstance* instance)
- : instance_(instance) {
+ : instance_(instance),
+ disable_3d_apis_(
+ CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) {
}
ResourceCreationImpl::~ResourceCreationImpl() {
@@ -104,6 +107,9 @@ PP_Resource ResourceCreationImpl::CreateContext3D(
PP_Config3D_Dev config,
PP_Resource share_context,
const int32_t* attrib_list) {
+ if (disable_3d_apis_)
+ return 0;
+
return PPB_Context3D_Impl::Create(instance, config, share_context,
attrib_list);
}
@@ -113,6 +119,9 @@ PP_Resource ResourceCreationImpl::CreateContext3DRaw(
PP_Config3D_Dev config,
PP_Resource share_context,
const int32_t* attrib_list) {
+ if (disable_3d_apis_)
+ return 0;
+
return PPB_Context3D_Impl::CreateRaw(instance, config, share_context,
attrib_list);
}
@@ -178,6 +187,9 @@ PP_Resource ResourceCreationImpl::CreateGraphics3D(
PP_Config3D_Dev config,
PP_Resource share_context,
const int32_t* attrib_list) {
+ if (disable_3d_apis_)
+ return 0;
+
return PPB_Graphics3D_Impl::Create(instance_, config, share_context,
attrib_list);
}
@@ -198,6 +210,9 @@ PP_Resource ResourceCreationImpl::CreateSurface3D(
PP_Instance instance,
PP_Config3D_Dev config,
const int32_t* attrib_list) {
+ if (disable_3d_apis_)
+ return 0;
+
return PPB_Surface3D_Impl::Create(instance_, config, attrib_list);
}
« no previous file with comments | « webkit/plugins/ppapi/resource_creation_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698