| 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_io_host.h" | 5 #include "content/browser/renderer_host/pepper/pepper_file_io_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_util_proxy.h" | 10 #include "base/files/file_util_proxy.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 PepperFileIOHost::PepperFileIOHost(BrowserPpapiHostImpl* host, | 106 PepperFileIOHost::PepperFileIOHost(BrowserPpapiHostImpl* host, |
| 107 PP_Instance instance, | 107 PP_Instance instance, |
| 108 PP_Resource resource) | 108 PP_Resource resource) |
| 109 : ResourceHost(host->GetPpapiHost(), instance, resource), | 109 : ResourceHost(host->GetPpapiHost(), instance, resource), |
| 110 browser_ppapi_host_(host), | 110 browser_ppapi_host_(host), |
| 111 render_process_host_(NULL), | 111 render_process_host_(NULL), |
| 112 file_(BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)), | 112 file_(BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) |
| 113 .get()), |
| 113 open_flags_(0), | 114 open_flags_(0), |
| 114 file_system_type_(PP_FILESYSTEMTYPE_INVALID), | 115 file_system_type_(PP_FILESYSTEMTYPE_INVALID), |
| 115 max_written_offset_(0), | 116 max_written_offset_(0), |
| 116 check_quota_(false) { | 117 check_quota_(false) { |
| 117 int unused; | 118 int unused; |
| 118 if (!host->GetRenderFrameIDsForInstance( | 119 if (!host->GetRenderFrameIDsForInstance( |
| 119 instance, &render_process_id_, &unused)) { | 120 instance, &render_process_id_, &unused)) { |
| 120 render_process_id_ = -1; | 121 render_process_id_ = -1; |
| 121 } | 122 } |
| 122 } | 123 } |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 489 |
| 489 ppapi::proxy::SerializedHandle file_handle; | 490 ppapi::proxy::SerializedHandle file_handle; |
| 490 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc. | 491 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc. |
| 491 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0; | 492 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0; |
| 492 file_handle.set_file_handle(transit_file, open_flags, quota_file_io); | 493 file_handle.set_file_handle(transit_file, open_flags, quota_file_io); |
| 493 reply_context->params.AppendHandle(file_handle); | 494 reply_context->params.AppendHandle(file_handle); |
| 494 return true; | 495 return true; |
| 495 } | 496 } |
| 496 | 497 |
| 497 } // namespace content | 498 } // namespace content |
| OLD | NEW |