OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/renderer/pepper/pepper_file_system_host.h" | 5 #include "content/renderer/pepper/pepper_file_system_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 "content/child/child_thread.h" | 9 #include "content/child/child_thread_impl.h" |
10 #include "content/child/fileapi/file_system_dispatcher.h" | 10 #include "content/child/fileapi/file_system_dispatcher.h" |
11 #include "content/common/pepper_file_util.h" | 11 #include "content/common/pepper_file_util.h" |
12 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 12 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
13 #include "content/public/renderer/render_view.h" | 13 #include "content/public/renderer/render_view.h" |
14 #include "content/public/renderer/renderer_ppapi_host.h" | 14 #include "content/public/renderer/renderer_ppapi_host.h" |
15 #include "ppapi/c/pp_errors.h" | 15 #include "ppapi/c/pp_errors.h" |
16 #include "ppapi/host/dispatch_host_message.h" | 16 #include "ppapi/host/dispatch_host_message.h" |
17 #include "ppapi/host/ppapi_host.h" | 17 #include "ppapi/host/ppapi_host.h" |
18 #include "ppapi/proxy/ppapi_messages.h" | 18 #include "ppapi/proxy/ppapi_messages.h" |
19 #include "ppapi/shared_impl/file_system_util.h" | 19 #include "ppapi/shared_impl/file_system_util.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 storage::FileSystemType file_system_type = | 95 storage::FileSystemType file_system_type = |
96 PepperFileSystemTypeToFileSystemType(type_); | 96 PepperFileSystemTypeToFileSystemType(type_); |
97 if (file_system_type == storage::kFileSystemTypeUnknown) | 97 if (file_system_type == storage::kFileSystemTypeUnknown) |
98 return PP_ERROR_FAILED; | 98 return PP_ERROR_FAILED; |
99 | 99 |
100 GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance()); | 100 GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance()); |
101 if (!document_url.is_valid()) | 101 if (!document_url.is_valid()) |
102 return PP_ERROR_FAILED; | 102 return PP_ERROR_FAILED; |
103 | 103 |
104 FileSystemDispatcher* file_system_dispatcher = | 104 FileSystemDispatcher* file_system_dispatcher = |
105 ChildThread::current()->file_system_dispatcher(); | 105 ChildThreadImpl::current()->file_system_dispatcher(); |
106 reply_context_ = context->MakeReplyMessageContext(); | 106 reply_context_ = context->MakeReplyMessageContext(); |
107 file_system_dispatcher->OpenFileSystem( | 107 file_system_dispatcher->OpenFileSystem( |
108 document_url.GetOrigin(), | 108 document_url.GetOrigin(), |
109 file_system_type, | 109 file_system_type, |
110 base::Bind(&PepperFileSystemHost::DidOpenFileSystem, | 110 base::Bind(&PepperFileSystemHost::DidOpenFileSystem, |
111 weak_factory_.GetWeakPtr()), | 111 weak_factory_.GetWeakPtr()), |
112 base::Bind(&PepperFileSystemHost::DidFailOpenFileSystem, | 112 base::Bind(&PepperFileSystemHost::DidFailOpenFileSystem, |
113 weak_factory_.GetWeakPtr())); | 113 weak_factory_.GetWeakPtr())); |
114 return PP_OK_COMPLETIONPENDING; | 114 return PP_OK_COMPLETIONPENDING; |
115 } | 115 } |
(...skipping 20 matching lines...) Expand all Loading... |
136 const std::string root_name = ppapi::IsolatedFileSystemTypeToRootName(type); | 136 const std::string root_name = ppapi::IsolatedFileSystemTypeToRootName(type); |
137 if (root_name.empty()) | 137 if (root_name.empty()) |
138 return PP_ERROR_BADARGUMENT; | 138 return PP_ERROR_BADARGUMENT; |
139 root_url_ = GURL(storage::GetIsolatedFileSystemRootURIString( | 139 root_url_ = GURL(storage::GetIsolatedFileSystemRootURIString( |
140 url.GetOrigin(), fsid, root_name)); | 140 url.GetOrigin(), fsid, root_name)); |
141 opened_ = true; | 141 opened_ = true; |
142 return PP_OK; | 142 return PP_OK; |
143 } | 143 } |
144 | 144 |
145 } // namespace content | 145 } // namespace content |
OLD | NEW |