Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_NACL_HOST_NACL_FILE_HOST_H_ | 5 #ifndef CHROME_BROWSER_NACL_HOST_NACL_FILE_HOST_H_ |
| 6 #define CHROME_BROWSER_NACL_HOST_NACL_FILE_HOST_H_ | 6 #define CHROME_BROWSER_NACL_HOST_NACL_FILE_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | |
| 10 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 | 13 |
| 13 class ExtensionInfoMap; | 14 class ExtensionInfoMap; |
| 14 class GURL; | 15 class GURL; |
| 15 class NaClHostMessageFilter; | 16 class NaClHostMessageFilter; |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class FilePath; | 19 class FilePath; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace IPC { | 22 namespace IPC { |
| 22 class Message; | 23 class Message; |
| 23 } | 24 } |
| 24 | 25 |
| 25 // Opens NaCl Files in the Browser process, on behalf of the NaCl plugin. | 26 // Opens NaCl Files in the Browser process, on behalf of the NaCl plugin. |
| 26 | 27 |
| 27 namespace nacl_file_host { | 28 namespace nacl_file_host { |
| 29 typedef base::Callback<void(bool)> InstallCallback; | |
| 30 typedef base::Callback<void(int64, int64)> InstallProgressCallback; | |
|
dmichael (off chromium)
2013/08/01 17:33:49
I think you ought to document here what those int6
jvoung (off chromium)
2013/08/02 18:32:36
Done.
| |
| 28 | 31 |
| 29 // Open a Pnacl file (readonly) on behalf of the NaCl plugin. | 32 // Ensure that PNaCl is installed. Calls |done_callback| if PNaCl is already |
| 33 // installed. Otherwise, issues a request to install and calls |done_callback| | |
| 34 // after that request completes w/ success or failure. | |
| 35 // If an request to install is issued, then |progress_callback| is called | |
|
dmichael (off chromium)
2013/08/01 17:33:49
s/an/a
jvoung (off chromium)
2013/08/01 23:14:07
Done.
| |
| 36 // with progress updates. | |
| 37 void EnsurePnaclInstalled( | |
| 38 const InstallCallback& done_callback, | |
| 39 const InstallProgressCallback& progress_callback); | |
| 40 | |
| 41 // Open a PNaCl file (readonly) on behalf of the NaCl plugin. | |
| 30 void GetReadonlyPnaclFd( | 42 void GetReadonlyPnaclFd( |
| 31 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter, | 43 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter, |
| 32 const std::string& filename, | 44 const std::string& filename, |
| 33 IPC::Message* reply_msg); | 45 IPC::Message* reply_msg); |
| 34 | 46 |
| 35 // Return true if the filename requested is valid for opening. | 47 // Return true if the filename requested is valid for opening. |
| 36 // Sets file_to_open to the base::FilePath which we will attempt to open. | 48 // Sets file_to_open to the base::FilePath which we will attempt to open. |
| 37 bool PnaclCanOpenFile(const std::string& filename, | 49 bool PnaclCanOpenFile(const std::string& filename, |
| 38 base::FilePath* file_to_open); | 50 base::FilePath* file_to_open); |
| 39 | 51 |
| 40 // Opens a NaCl executable file for reading and executing. | 52 // Opens a NaCl executable file for reading and executing. |
| 41 void OpenNaClExecutable( | 53 void OpenNaClExecutable( |
| 42 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter, | 54 scoped_refptr<NaClHostMessageFilter> nacl_host_message_filter, |
| 43 scoped_refptr<ExtensionInfoMap> extension_info_map, | 55 scoped_refptr<ExtensionInfoMap> extension_info_map, |
| 44 int render_view_id, | 56 int render_view_id, |
| 45 const GURL& file_url, | 57 const GURL& file_url, |
| 46 IPC::Message* reply_msg); | 58 IPC::Message* reply_msg); |
| 47 | 59 |
| 48 } // namespace nacl_file_host | 60 } // namespace nacl_file_host |
| 49 | 61 |
| 50 #endif // CHROME_BROWSER_NACL_HOST_NACL_FILE_HOST_H_ | 62 #endif // CHROME_BROWSER_NACL_HOST_NACL_FILE_HOST_H_ |
| OLD | NEW |