Chromium Code Reviews| 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 // TODO(dcheng): This seems sketchy. Does this not need to be ref'ed? |
| 113 file_(BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) | |
|
dcheng
2014/08/28 16:40:16
Do we need to ref this? Most other places seem to
raymes
2014/08/29 01:12:45
It looks like the base::FileProxy holds a ref, so
dcheng
2014/08/29 06:38:01
OK I've removed this comment then.
| |
| 114 .get()), | |
| 113 open_flags_(0), | 115 open_flags_(0), |
| 114 file_system_type_(PP_FILESYSTEMTYPE_INVALID), | 116 file_system_type_(PP_FILESYSTEMTYPE_INVALID), |
| 115 max_written_offset_(0), | 117 max_written_offset_(0), |
| 116 check_quota_(false) { | 118 check_quota_(false) { |
| 117 int unused; | 119 int unused; |
| 118 if (!host->GetRenderFrameIDsForInstance( | 120 if (!host->GetRenderFrameIDsForInstance( |
| 119 instance, &render_process_id_, &unused)) { | 121 instance, &render_process_id_, &unused)) { |
| 120 render_process_id_ = -1; | 122 render_process_id_ = -1; |
| 121 } | 123 } |
| 122 } | 124 } |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 488 | 490 |
| 489 ppapi::proxy::SerializedHandle file_handle; | 491 ppapi::proxy::SerializedHandle file_handle; |
| 490 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc. | 492 // A non-zero resource id signals NaClIPCAdapter to create a NaClQuotaDesc. |
| 491 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0; | 493 PP_Resource quota_file_io = check_quota_ ? pp_resource() : 0; |
| 492 file_handle.set_file_handle(transit_file, open_flags, quota_file_io); | 494 file_handle.set_file_handle(transit_file, open_flags, quota_file_io); |
| 493 reply_context->params.AppendHandle(file_handle); | 495 reply_context->params.AppendHandle(file_handle); |
| 494 return true; | 496 return true; |
| 495 } | 497 } |
| 496 | 498 |
| 497 } // namespace content | 499 } // namespace content |
| OLD | NEW |