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.h" |
10 #include "content/child/fileapi/file_system_dispatcher.h" | 10 #include "content/child/fileapi/file_system_dispatcher.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 opened_(true), | 46 opened_(true), |
47 root_url_(root_url), | 47 root_url_(root_url), |
48 called_open_(true), | 48 called_open_(true), |
49 weak_factory_(this) {} | 49 weak_factory_(this) {} |
50 | 50 |
51 PepperFileSystemHost::~PepperFileSystemHost() {} | 51 PepperFileSystemHost::~PepperFileSystemHost() {} |
52 | 52 |
53 int32_t PepperFileSystemHost::OnResourceMessageReceived( | 53 int32_t PepperFileSystemHost::OnResourceMessageReceived( |
54 const IPC::Message& msg, | 54 const IPC::Message& msg, |
55 ppapi::host::HostMessageContext* context) { | 55 ppapi::host::HostMessageContext* context) { |
56 IPC_BEGIN_MESSAGE_MAP(PepperFileSystemHost, msg) | 56 PPAPI_BEGIN_MESSAGE_MAP(PepperFileSystemHost, msg) |
57 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_FileSystem_Open, OnHostMsgOpen) | 57 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_FileSystem_Open, |
58 PPAPI_DISPATCH_HOST_RESOURCE_CALL( | 58 OnHostMsgOpen) |
59 PpapiHostMsg_FileSystem_InitIsolatedFileSystem, | 59 PPAPI_DISPATCH_HOST_RESOURCE_CALL( |
60 OnHostMsgInitIsolatedFileSystem) | 60 PpapiHostMsg_FileSystem_InitIsolatedFileSystem, |
61 IPC_END_MESSAGE_MAP() | 61 OnHostMsgInitIsolatedFileSystem) |
| 62 PPAPI_END_MESSAGE_MAP() |
62 return PP_ERROR_FAILED; | 63 return PP_ERROR_FAILED; |
63 } | 64 } |
64 | 65 |
65 bool PepperFileSystemHost::IsFileSystemHost() { return true; } | 66 bool PepperFileSystemHost::IsFileSystemHost() { return true; } |
66 | 67 |
67 void PepperFileSystemHost::DidOpenFileSystem( | 68 void PepperFileSystemHost::DidOpenFileSystem( |
68 const std::string& /* name_unused */, | 69 const std::string& /* name_unused */, |
69 const GURL& root) { | 70 const GURL& root) { |
70 opened_ = true; | 71 opened_ = true; |
71 root_url_ = root; | 72 root_url_ = root; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 const std::string root_name = ppapi::IsolatedFileSystemTypeToRootName(type); | 135 const std::string root_name = ppapi::IsolatedFileSystemTypeToRootName(type); |
135 if (root_name.empty()) | 136 if (root_name.empty()) |
136 return PP_ERROR_BADARGUMENT; | 137 return PP_ERROR_BADARGUMENT; |
137 root_url_ = GURL(fileapi::GetIsolatedFileSystemRootURIString( | 138 root_url_ = GURL(fileapi::GetIsolatedFileSystemRootURIString( |
138 url.GetOrigin(), fsid, root_name)); | 139 url.GetOrigin(), fsid, root_name)); |
139 opened_ = true; | 140 opened_ = true; |
140 return PP_OK; | 141 return PP_OK; |
141 } | 142 } |
142 | 143 |
143 } // namespace content | 144 } // namespace content |
OLD | NEW |