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

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: rebase 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
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | ppapi/cpp/graphics_2d.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 da42d8598716b2bd6e595652656fa0839dad1c51..fff104e392f9e50193194b6c46d9ea79445c5f3a 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -6,16 +6,19 @@
#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 "content/renderer/render_widget_fullscreen_pepper.h"
+#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
#include "ui/gfx/point.h"
#include "webkit/plugins/ppapi/fullscreen_container.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"
@@ -64,6 +67,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.
@@ -78,6 +82,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() {
@@ -150,6 +155,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);
@@ -224,6 +241,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);
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | ppapi/cpp/graphics_2d.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698