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

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

Issue 11419131: Refactor FileIO to the 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 da42d8598716b2bd6e595652656fa0839dad1c51..8697bcd3057b29d25102adede8ce56e07133f5c8 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -20,6 +20,7 @@
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
using webkit::ppapi::HostGlobals;
+using webkit::ppapi::PluginDelegate;
using webkit::ppapi::PluginInstance;
using webkit::ppapi::PluginModule;
@@ -138,16 +139,24 @@ ppapi::host::PpapiHost* RendererPpapiHostImpl::GetPpapiHost() {
return ppapi_host_.get();
}
-RenderView* RendererPpapiHostImpl::GetRenderViewForInstance(
+PluginDelegate* RendererPpapiHostImpl::GetDelegateForInstance(
PP_Instance instance) const {
PluginInstance* instance_object = GetAndValidateInstance(instance);
if (!instance_object)
return NULL;
+ return instance_object->delegate();
+}
+
+RenderView* RendererPpapiHostImpl::GetRenderViewForInstance(
+ PP_Instance instance) const {
+ webkit::ppapi::PluginDelegate* delegate = GetDelegateForInstance(instance);
+ if (!delegate)
+ return NULL;
+
// Since we're the embedder, we can make assumptions about the delegate on
// the instance and get back to our RenderView.
- return static_cast<PepperPluginDelegateImpl*>(
- instance_object->delegate())->render_view();
+ return static_cast<PepperPluginDelegateImpl*>(delegate)->render_view();
}
bool RendererPpapiHostImpl::IsValidInstance(

Powered by Google App Engine
This is Rietveld 408576698