| 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 21 matching lines...) Expand all Loading... |
| 32 PP_Resource file_system, | 32 PP_Resource file_system, |
| 33 const std::string& path) | 33 const std::string& path) |
| 34 : ResourceHost(host->GetPpapiHost(), instance, resource), | 34 : ResourceHost(host->GetPpapiHost(), instance, resource), |
| 35 host_(host), | 35 host_(host), |
| 36 fs_type_(PP_FILESYSTEMTYPE_INVALID) { | 36 fs_type_(PP_FILESYSTEMTYPE_INVALID) { |
| 37 if (!ppapi::IsValidInternalPath(path)) | 37 if (!ppapi::IsValidInternalPath(path)) |
| 38 return; | 38 return; |
| 39 | 39 |
| 40 int render_process_id; | 40 int render_process_id; |
| 41 int unused; | 41 int unused; |
| 42 if (!host->GetRenderViewIDsForInstance(instance, | 42 if (!host->GetRenderFrameIDsForInstance(instance, |
| 43 &render_process_id, | 43 &render_process_id, |
| 44 &unused)) { | 44 &unused)) { |
| 45 return; | 45 return; |
| 46 } | 46 } |
| 47 | 47 |
| 48 ResourceHost* fs_resource_host = | 48 ResourceHost* fs_resource_host = |
| 49 host->GetPpapiHost()->GetResourceHost(file_system); | 49 host->GetPpapiHost()->GetResourceHost(file_system); |
| 50 if (fs_resource_host == NULL) { | 50 if (fs_resource_host == NULL) { |
| 51 DLOG(ERROR) << "Couldn't find FileSystem host: " << resource | 51 DLOG(ERROR) << "Couldn't find FileSystem host: " << resource |
| 52 << " path: " << path; | 52 << " path: " << path; |
| 53 return; | 53 return; |
| 54 } | 54 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 81 PP_Resource resource, | 81 PP_Resource resource, |
| 82 const base::FilePath& external_path) | 82 const base::FilePath& external_path) |
| 83 : ResourceHost(host->GetPpapiHost(), instance, resource), | 83 : ResourceHost(host->GetPpapiHost(), instance, resource), |
| 84 host_(host), | 84 host_(host), |
| 85 fs_type_(PP_FILESYSTEMTYPE_EXTERNAL) { | 85 fs_type_(PP_FILESYSTEMTYPE_EXTERNAL) { |
| 86 if (!ppapi::IsValidExternalPath(external_path)) | 86 if (!ppapi::IsValidExternalPath(external_path)) |
| 87 return; | 87 return; |
| 88 | 88 |
| 89 int render_process_id; | 89 int render_process_id; |
| 90 int unused; | 90 int unused; |
| 91 if (!host->GetRenderViewIDsForInstance(instance, | 91 if (!host->GetRenderFrameIDsForInstance(instance, |
| 92 &render_process_id, | 92 &render_process_id, |
| 93 &unused)) { | 93 &unused)) { |
| 94 return; | 94 return; |
| 95 } | 95 } |
| 96 | 96 |
| 97 backend_.reset(new PepperExternalFileRefBackend(host->GetPpapiHost(), | 97 backend_.reset(new PepperExternalFileRefBackend(host->GetPpapiHost(), |
| 98 render_process_id, | 98 render_process_id, |
| 99 external_path)); | 99 external_path)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 PepperFileRefHost::~PepperFileRefHost() { | 102 PepperFileRefHost::~PepperFileRefHost() { |
| 103 } | 103 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 int32_t PepperFileRefHost::OnGetAbsolutePath( | 251 int32_t PepperFileRefHost::OnGetAbsolutePath( |
| 252 ppapi::host::HostMessageContext* context) { | 252 ppapi::host::HostMessageContext* context) { |
| 253 if (!host_->GetPpapiHost()->permissions().HasPermission( | 253 if (!host_->GetPpapiHost()->permissions().HasPermission( |
| 254 ppapi::PERMISSION_PRIVATE)) | 254 ppapi::PERMISSION_PRIVATE)) |
| 255 return PP_ERROR_NOACCESS; | 255 return PP_ERROR_NOACCESS; |
| 256 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); | 256 return backend_->GetAbsolutePath(context->MakeReplyMessageContext()); |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace content | 259 } // namespace content |
| OLD | NEW |