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
" |
11 #include "content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.
h" | 11 #include "content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.
h" |
12 #include "ppapi/c/pp_errors.h" | 12 #include "ppapi/c/pp_errors.h" |
13 #include "ppapi/c/pp_file_info.h" | 13 #include "ppapi/c/pp_file_info.h" |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/host/dispatch_host_message.h" | 16 #include "ppapi/host/dispatch_host_message.h" |
17 #include "ppapi/host/ppapi_host.h" | 17 #include "ppapi/host/ppapi_host.h" |
18 #include "ppapi/proxy/ppapi_messages.h" | 18 #include "ppapi/proxy/ppapi_messages.h" |
19 #include "ppapi/shared_impl/file_ref_util.h" | 19 #include "ppapi/shared_impl/file_ref_util.h" |
20 #include "webkit/browser/fileapi/file_permission_policy.h" | 20 #include "storage/browser/fileapi/file_permission_policy.h" |
21 | 21 |
22 using ppapi::host::ResourceHost; | 22 using ppapi::host::ResourceHost; |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 PepperFileRefBackend::~PepperFileRefBackend() {} | 26 PepperFileRefBackend::~PepperFileRefBackend() {} |
27 | 27 |
28 PepperFileRefHost::PepperFileRefHost(BrowserPpapiHost* host, | 28 PepperFileRefHost::PepperFileRefHost(BrowserPpapiHost* host, |
29 PP_Instance instance, | 29 PP_Instance instance, |
30 PP_Resource resource, | 30 PP_Resource resource, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 | 103 |
104 PepperFileRefHost::~PepperFileRefHost() {} | 104 PepperFileRefHost::~PepperFileRefHost() {} |
105 | 105 |
106 bool PepperFileRefHost::IsFileRefHost() { return true; } | 106 bool PepperFileRefHost::IsFileRefHost() { return true; } |
107 | 107 |
108 PP_FileSystemType PepperFileRefHost::GetFileSystemType() const { | 108 PP_FileSystemType PepperFileRefHost::GetFileSystemType() const { |
109 return fs_type_; | 109 return fs_type_; |
110 } | 110 } |
111 | 111 |
112 fileapi::FileSystemURL PepperFileRefHost::GetFileSystemURL() const { | 112 storage::FileSystemURL PepperFileRefHost::GetFileSystemURL() const { |
113 if (backend_) | 113 if (backend_) |
114 return backend_->GetFileSystemURL(); | 114 return backend_->GetFileSystemURL(); |
115 return fileapi::FileSystemURL(); | 115 return storage::FileSystemURL(); |
116 } | 116 } |
117 | 117 |
118 base::FilePath PepperFileRefHost::GetExternalFilePath() const { | 118 base::FilePath PepperFileRefHost::GetExternalFilePath() const { |
119 if (backend_) | 119 if (backend_) |
120 return backend_->GetExternalFilePath(); | 120 return backend_->GetExternalFilePath(); |
121 return base::FilePath(); | 121 return base::FilePath(); |
122 } | 122 } |
123 | 123 |
124 base::WeakPtr<PepperFileSystemBrowserHost> | 124 base::WeakPtr<PepperFileSystemBrowserHost> |
125 PepperFileRefHost::GetFileSystemHost() const { | 125 PepperFileRefHost::GetFileSystemHost() const { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 241 |
242 int32_t PepperFileRefHost::OnGetAbsolutePath( | 242 int32_t PepperFileRefHost::OnGetAbsolutePath( |
243 ppapi::host::HostMessageContext* context) { | 243 ppapi::host::HostMessageContext* context) { |
244 if (!host_->GetPpapiHost()->permissions().HasPermission( | 244 if (!host_->GetPpapiHost()->permissions().HasPermission( |
245 ppapi::PERMISSION_PRIVATE)) | 245 ppapi::PERMISSION_PRIVATE)) |
246 return PP_ERROR_NOACCESS; | 246 return PP_ERROR_NOACCESS; |
247 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); | 247 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); |
248 } | 248 } |
249 | 249 |
250 } // namespace content | 250 } // namespace content |
OLD | NEW |