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

Unified Diff: content/renderer/pepper/renderer_ppapi_host_impl.cc

Issue 11053003: Migrate Graphics2D to new design. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
Index: content/renderer/pepper/renderer_ppapi_host_impl.cc
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index a9667ad3301ff6383c6cf4b0a679a9f631c9d4bd..1fa53d1238c1dc2ef4151207f71eca3d0dc9f833 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -6,12 +6,15 @@
#include "base/file_path.h"
#include "base/logging.h"
+#include "content/renderer/pepper/pepper_graphics_2d_host.h"
#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "content/renderer/pepper/pepper_in_process_router.h"
#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
#include "content/renderer/render_view_impl.h"
+#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "webkit/plugins/ppapi/host_globals.h"
+#include "webkit/plugins/ppapi/plugin_delegate.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
@@ -60,6 +63,7 @@ RendererPpapiHostImpl::RendererPpapiHostImpl(
ppapi_host_->AddHostFactoryFilter(scoped_ptr<ppapi::host::HostFactory>(
new ContentRendererPepperHostFactory(this)));
dispatcher->AddFilter(ppapi_host_.get());
+ is_running_in_process_ = false;
}
// In-process constructor.
@@ -74,6 +78,7 @@ RendererPpapiHostImpl::RendererPpapiHostImpl(
in_process_router_->GetRendererToPluginSender(), permissions));
ppapi_host_->AddHostFactoryFilter(scoped_ptr<ppapi::host::HostFactory>(
new ContentRendererPepperHostFactory(this)));
+ is_running_in_process_ = true;
}
RendererPpapiHostImpl::~RendererPpapiHostImpl() {
@@ -146,6 +151,18 @@ RenderView* RendererPpapiHostImpl::GetRenderViewForInstance(
instance_object->delegate())->render_view();
}
+webkit::ppapi::PluginDelegate::PlatformGraphics2D*
+RendererPpapiHostImpl::GetPlatformGraphics2D(
+ PP_Resource resource) {
+ ppapi::host::ResourceHost* resource_host =
+ GetPpapiHost()->GetResourceHost(resource);
+ if (!resource_host || !resource_host->IsGraphics2DHost()) {
+ DLOG(ERROR) << "Resource is not Graphics2D";
+ return NULL;
+ }
+ return static_cast<PepperGraphics2DHost*>(resource_host);
+}
+
bool RendererPpapiHostImpl::IsValidInstance(
PP_Instance instance) const {
return !!GetAndValidateInstance(instance);
@@ -186,6 +203,10 @@ IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote(
return dispatcher_->ShareHandleWithRemote(handle, should_close_source);
}
+bool RendererPpapiHostImpl::IsRunningInProcess() const {
+ return is_running_in_process_;
+}
+
PluginInstance* RendererPpapiHostImpl::GetAndValidateInstance(
PP_Instance pp_instance) const {
PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance);

Powered by Google App Engine
This is Rietveld 408576698