OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/pepper/pepper_file_ref_host.h" | 5 #include "content/browser/renderer_host/pepper/pepper_file_ref_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "content/browser/renderer_host/pepper/pepper_external_file_ref_backend.
h" | 9 #include "content/browser/renderer_host/pepper/pepper_external_file_ref_backend.
h" |
10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" | 10 #include "content/browser/renderer_host/pepper/pepper_file_system_browser_host.h
" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 PepperFileSystemBrowserHost* fs_host = NULL; | 56 PepperFileSystemBrowserHost* fs_host = NULL; |
57 if (fs_resource_host->IsFileSystemHost()) | 57 if (fs_resource_host->IsFileSystemHost()) |
58 fs_host = static_cast<PepperFileSystemBrowserHost*>(fs_resource_host); | 58 fs_host = static_cast<PepperFileSystemBrowserHost*>(fs_resource_host); |
59 if (fs_host == NULL) { | 59 if (fs_host == NULL) { |
60 DLOG(ERROR) << "Filesystem PP_Resource is not PepperFileSystemBrowserHost"; | 60 DLOG(ERROR) << "Filesystem PP_Resource is not PepperFileSystemBrowserHost"; |
61 return; | 61 return; |
62 } | 62 } |
63 | 63 |
64 fs_type_ = fs_host->GetType(); | 64 fs_type_ = fs_host->GetType(); |
65 // TODO(teravest): Add support for isolated filesystems. | |
66 if ((fs_type_ != PP_FILESYSTEMTYPE_LOCALPERSISTENT) && | 65 if ((fs_type_ != PP_FILESYSTEMTYPE_LOCALPERSISTENT) && |
67 (fs_type_ != PP_FILESYSTEMTYPE_LOCALTEMPORARY)) { | 66 (fs_type_ != PP_FILESYSTEMTYPE_LOCALTEMPORARY) && |
| 67 (fs_type_ != PP_FILESYSTEMTYPE_ISOLATED)) { |
68 DLOG(ERROR) << "Unsupported filesystem type: " << fs_type_; | 68 DLOG(ERROR) << "Unsupported filesystem type: " << fs_type_; |
69 return; | 69 return; |
70 } | 70 } |
71 | 71 |
72 backend_.reset(new PepperInternalFileRefBackend( | 72 backend_.reset(new PepperInternalFileRefBackend( |
73 host->GetPpapiHost(), | 73 host->GetPpapiHost(), |
74 render_process_id, | 74 render_process_id, |
75 base::AsWeakPtr(fs_host), | 75 base::AsWeakPtr(fs_host), |
76 path)); | 76 path)); |
77 } | 77 } |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 int32_t PepperFileRefHost::OnGetAbsolutePath( | 252 int32_t PepperFileRefHost::OnGetAbsolutePath( |
253 ppapi::host::HostMessageContext* context) { | 253 ppapi::host::HostMessageContext* context) { |
254 if (!host_->GetPpapiHost()->permissions().HasPermission( | 254 if (!host_->GetPpapiHost()->permissions().HasPermission( |
255 ppapi::PERMISSION_PRIVATE)) | 255 ppapi::PERMISSION_PRIVATE)) |
256 return PP_ERROR_NOACCESS; | 256 return PP_ERROR_NOACCESS; |
257 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); | 257 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); |
258 } | 258 } |
259 | 259 |
260 } // namespace content | 260 } // namespace content |
OLD | NEW |