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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_filesystem_provider_host.cc

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved several modules to chromeos folder. Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/pepper/pepper_filesystem_provider_host.h "
6 #include "content/browser/renderer_host/pepper/pepper_filesystem_provider_backen d_chromeos.h"
7 #include "content/public/browser/browser_ppapi_host.h"
8 #include "ppapi/host/dispatch_host_message.h"
9 #include "ppapi/host/ppapi_host.h"
10 #include "ppapi/proxy/ppapi_messages.h"
11
12
13 namespace content {
14
15 PepperFilesystemProviderBackend::~PepperFilesystemProviderBackend(){}
16
17 PepperFilesystemProviderHost::PepperFilesystemProviderHost(
18 BrowserPpapiHost* host, PP_Instance instance, PP_Resource resource)
19 : ResourceHost(
20 host ? host->GetPpapiHost() : nullptr,
21 instance,
22 resource )
23 #if defined(OS_CHROMEOS)
24 , backend_( new PepperFilesystemProviderBackendChromeOS(
25 host,
26 instance,
27 resource) )
28 #endif
29 {
30
31 }
32
33 PepperFilesystemProviderHost::~PepperFilesystemProviderHost() {
34
35 }
36 // This is a dispatcher for all requests
37 // received from the plugin
38 int32_t PepperFilesystemProviderHost::OnResourceMessageReceived(
39 const IPC::Message& msg, ppapi::host::HostMessageContext* context) {
40 if ( !host()->permissions().HasPermission( ppapi::PERMISSION_DEV ) )
41 return PP_ERROR_FAILED;
42
43 PPAPI_BEGIN_MESSAGE_MAP( PepperFilesystemProviderHost, msg )
44 PPAPI_DISPATCH_HOST_RESOURCE_CALL(
45 PpapiHostMsg_FilesystemProvider_Mount,
46 OnHostMsgMount )
47 PPAPI_DISPATCH_HOST_RESOURCE_CALL(
48 PpapiHostMsg_FilesystemProvider_Unmount,
49 OnHostMsgUnmount )
50 PPAPI_DISPATCH_HOST_RESOURCE_CALL(
51 PpapiHostMsg_FilesystemProvider_OperationResponse,
52 OnHostMsgPluginResponse)
53 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(
54 PpapiHostMsg_FilesystemProvider_WriteAck,
55 OnHostMsgPluginWriteAck)
56 PPAPI_DISPATCH_HOST_RESOURCE_CALL(
57 PpapiHostMsg_FilesystemProvider_Notify,
58 OnHostMsgPluginNotification)
59 PPAPI_END_MESSAGE_MAP()
60
61 return PP_ERROR_FAILED;
62 }
63
64 int32_t PepperFilesystemProviderHost::OnHostMsgMount(
65 ppapi::host::HostMessageContext* context, const base::ListValue& request) {
66 if(!backend_.get())
67 return PP_ERROR_NOTSUPPORTED;
68 return backend_->SendMountRequest(context, request);
69 }
70
71 int32_t PepperFilesystemProviderHost::OnHostMsgUnmount(
72 ppapi::host::HostMessageContext* context,
73 const std::string& filesystem_id) {
74 if(!backend_.get())
75 return PP_ERROR_NOTSUPPORTED;
76 return backend_->SendUnmountRequest(context,filesystem_id);
77 }
78
79 int32_t PepperFilesystemProviderHost::OnHostMsgPluginResponse(
80 ppapi::host::HostMessageContext* context, const base::ListValue& response) {
81 if(!backend_.get())
82 return PP_ERROR_NOTSUPPORTED;
83 return backend_->OnPluginResponse(context,response);
84 }
85
86 int32_t PepperFilesystemProviderHost::OnHostMsgPluginWriteAck(
87 ppapi::host::HostMessageContext* context) {
88 if (!backend_.get())
89 return PP_ERROR_NOTSUPPORTED;
90 return backend_->OnPluginWriteAck(context);
91 }
92
93 int32_t PepperFilesystemProviderHost::OnHostMsgPluginNotification(
94 ppapi::host::HostMessageContext* context, const base::ListValue& response) {
95 if (!backend_.get())
96 return PP_ERROR_NOTSUPPORTED;
97 return backend_->OnPluginNotification(context,response);
98 }
99
100 } // namespace content
101
OLDNEW
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_filesystem_provider_host.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698