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

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

Issue 13726024: Refactor FileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NON_EXPORTED_BASE 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
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 335cd02bbd10ab0dbeee56561837366d10fa1382..f3edfb4fa502993878738ee4e25c0d70a6f0c2d3 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -43,6 +43,7 @@
#include "content/renderer/pepper/content_renderer_pepper_host_factory.h"
#include "content/renderer/pepper/pepper_broker_impl.h"
#include "content/renderer/pepper/pepper_device_enumeration_event_handler.h"
+#include "content/renderer/pepper/pepper_file_system_host.h"
#include "content/renderer/pepper/pepper_hung_plugin_filter.h"
#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "content/renderer/pepper/pepper_platform_audio_input_impl.h"
@@ -343,6 +344,16 @@ 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)
@@ -1019,15 +1030,25 @@ void PepperPluginDelegateImpl::WillHandleMouseEvent() {
last_mouse_event_target_ = NULL;
}
-bool PepperPluginDelegateImpl::OpenFileSystem(
- const GURL& origin_url,
- fileapi::FileSystemType type,
- long long size,
- fileapi::FileSystemCallbackDispatcher* dispatcher) {
- FileSystemDispatcher* file_system_dispatcher =
- ChildThread::current()->file_system_dispatcher();
- return file_system_dispatcher->OpenFileSystem(
- origin_url, type, size, true /* create */, dispatcher);
+bool PepperPluginDelegateImpl::IsFileSystemOpened(PP_Instance instance,
+ PP_Resource resource) const {
+ const PepperFileSystemHost* host =
+ GetRendererResourceHost<PepperFileSystemHost>(instance, resource);
+ return host && host->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;
+}
+
+GURL PepperPluginDelegateImpl::GetFileSystemRootUrl(
+ PP_Instance instance, PP_Resource resource) const {
+ const PepperFileSystemHost* host =
+ GetRendererResourceHost<PepperFileSystemHost>(instance, resource);
+ return host ? host->GetRootUrl() : GURL();
}
bool PepperPluginDelegateImpl::MakeDirectory(
@@ -1622,4 +1643,10 @@ IPC::PlatformFileForTransit PepperPluginDelegateImpl::ShareHandleWithRemote(
should_close_source);
}
+bool PepperPluginDelegateImpl::IsRunningInProcess(PP_Instance instance) const {
+ RendererPpapiHostImpl* host =
+ RendererPpapiHostImpl::GetForPPInstance(instance);
+ return host && host->IsRunningInProcess();
+}
+
} // namespace content
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698