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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 : ResourceHost(host->GetPpapiHost(), instance, resource), | 87 : ResourceHost(host->GetPpapiHost(), instance, resource), |
88 browser_ppapi_host_(host), | 88 browser_ppapi_host_(host), |
89 render_process_host_(NULL), | 89 render_process_host_(NULL), |
90 file_(base::kInvalidPlatformFileValue), | 90 file_(base::kInvalidPlatformFileValue), |
91 open_flags_(0), | 91 open_flags_(0), |
92 file_system_type_(PP_FILESYSTEMTYPE_INVALID), | 92 file_system_type_(PP_FILESYSTEMTYPE_INVALID), |
93 max_written_offset_(0), | 93 max_written_offset_(0), |
94 check_quota_(false), | 94 check_quota_(false), |
95 weak_factory_(this) { | 95 weak_factory_(this) { |
96 int unused; | 96 int unused; |
97 if (!host->GetRenderViewIDsForInstance(instance, | 97 if (!host->GetRenderFrameIDsForInstance(instance, |
98 &render_process_id_, | 98 &render_process_id_, |
99 &unused)) { | 99 &unused)) { |
100 render_process_id_ = -1; | 100 render_process_id_ = -1; |
101 } | 101 } |
102 file_message_loop_ = BrowserThread::GetMessageLoopProxyForThread( | 102 file_message_loop_ = BrowserThread::GetMessageLoopProxyForThread( |
103 BrowserThread::FILE); | 103 BrowserThread::FILE); |
104 } | 104 } |
105 | 105 |
106 PepperFileIOHost::~PepperFileIOHost() { | 106 PepperFileIOHost::~PepperFileIOHost() { |
107 OnHostMsgClose(NULL); | 107 OnHostMsgClose(NULL); |
108 } | 108 } |
109 | 109 |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 file_, plugin_process_id, false); | 600 file_, plugin_process_id, false); |
601 if (transit_file == IPC::InvalidPlatformFileForTransit()) | 601 if (transit_file == IPC::InvalidPlatformFileForTransit()) |
602 return false; | 602 return false; |
603 ppapi::proxy::SerializedHandle file_handle; | 603 ppapi::proxy::SerializedHandle file_handle; |
604 file_handle.set_file_handle(transit_file, open_flags, 0 /* file_io */); | 604 file_handle.set_file_handle(transit_file, open_flags, 0 /* file_io */); |
605 reply_context->params.AppendHandle(file_handle); | 605 reply_context->params.AppendHandle(file_handle); |
606 return true; | 606 return true; |
607 } | 607 } |
608 | 608 |
609 } // namespace content | 609 } // namespace content |
OLD | NEW |