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

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

Issue 14188019: CRX FileSystem Pepper private API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 42bcf50a8dea5fb176b833c6b13df64b1193fbd0..39ad0d5f5f47e803d79cb74290a12e449572e723 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -64,6 +64,7 @@
#include "ppapi/c/dev/pp_video_dev.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_flash.h"
+#include "ppapi/host/file_system_registry.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -344,16 +345,6 @@ void CreateHostForInProcessModule(RenderViewImpl* render_view,
render_view->PpapiPluginCreated(host_impl);
}
-template <typename HostType>
-const HostType* GetRendererResourceHost(
- PP_Instance instance, PP_Resource resource) {
- const ppapi::host::PpapiHost* ppapi_host =
- RendererPpapiHost::GetForPPInstance(instance)->GetPpapiHost();
- if (!resource || !ppapi_host)
- return NULL;
- return static_cast<HostType*>(ppapi_host->GetResourceHost(resource));
-}
-
} // namespace
PepperPluginDelegateImpl::PepperPluginDelegateImpl(RenderViewImpl* render_view)
@@ -1032,23 +1023,21 @@ void PepperPluginDelegateImpl::WillHandleMouseEvent() {
bool PepperPluginDelegateImpl::IsFileSystemOpened(PP_Instance instance,
PP_Resource resource) const {
- const PepperFileSystemHost* host =
- GetRendererResourceHost<PepperFileSystemHost>(instance, resource);
- return host && host->IsOpened();
+ return ppapi::host::FileSystemRegistry::GetInstance()->
yzshen1 2013/05/02 23:22:01 You should remove all changes in this file.
victorhsieh 2013/05/03 17:26:58 Done.
+ LookUp(instance, resource).IsOpened();
}
PP_FileSystemType PepperPluginDelegateImpl::GetFileSystemType(
- PP_Instance instance, PP_Resource resource) const {
- const PepperFileSystemHost* host =
- GetRendererResourceHost<PepperFileSystemHost>(instance, resource);
- return host ? host->GetType() : PP_FILESYSTEMTYPE_INVALID;
+ PP_Instance instance,
+ PP_Resource resource) const {
+ return ppapi::host::FileSystemRegistry::GetInstance()->
+ LookUp(instance, resource).GetType();
}
GURL PepperPluginDelegateImpl::GetFileSystemRootUrl(
PP_Instance instance, PP_Resource resource) const {
- const PepperFileSystemHost* host =
- GetRendererResourceHost<PepperFileSystemHost>(instance, resource);
- return host ? host->GetRootUrl() : GURL();
+ return ppapi::host::FileSystemRegistry::GetInstance()->
+ LookUp(instance, resource).GetRootUrl();
}
bool PepperPluginDelegateImpl::MakeDirectory(

Powered by Google App Engine
This is Rietveld 408576698