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