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 #ifndef COMPONENTS_NACL_BROWSER_PNACL_HOST_H_ | 5 #ifndef COMPONENTS_NACL_BROWSER_PNACL_HOST_H_ |
6 #define COMPONENTS_NACL_BROWSER_PNACL_HOST_H_ | 6 #define COMPONENTS_NACL_BROWSER_PNACL_HOST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // If the nexe is already present | 59 // If the nexe is already present |
60 // in the cache, |is_hit| is set to true and the contents of the nexe | 60 // in the cache, |is_hit| is set to true and the contents of the nexe |
61 // have been copied into the temporary file. Otherwise |is_hit| is set to | 61 // have been copied into the temporary file. Otherwise |is_hit| is set to |
62 // false and the temporary file will be writeable. | 62 // false and the temporary file will be writeable. |
63 // Currently the implementation is a stub, which always sets is_hit to false | 63 // Currently the implementation is a stub, which always sets is_hit to false |
64 // and calls the implementation of CreateTemporaryFile. | 64 // and calls the implementation of CreateTemporaryFile. |
65 // If the cache request was a miss, the caller is expected to call | 65 // If the cache request was a miss, the caller is expected to call |
66 // TranslationFinished after it finishes translation to allow the nexe to be | 66 // TranslationFinished after it finishes translation to allow the nexe to be |
67 // stored in the cache. | 67 // stored in the cache. |
68 // The returned temp fd may be closed at any time by PnaclHost, so it should | 68 // The returned temp fd may be closed at any time by PnaclHost, so it should |
69 // be duplicated (e.g. with IPC::GetFileHandleForProcess) before the callback | 69 // be duplicated (e.g. with IPC::GetPlatformFileForTransit) before the |
70 // returns. | 70 // callback returns. |
71 // If |is_incognito| is true, the nexe will not be stored | 71 // If |is_incognito| is true, the nexe will not be stored |
72 // in the cache, but the renderer is still expected to call | 72 // in the cache, but the renderer is still expected to call |
73 // TranslationFinished. | 73 // TranslationFinished. |
74 void GetNexeFd(int render_process_id, | 74 void GetNexeFd(int render_process_id, |
75 int render_view_id, | 75 int render_view_id, |
76 int pp_instance, | 76 int pp_instance, |
77 bool is_incognito, | 77 bool is_incognito, |
78 const nacl::PnaclCacheInfo& cache_info, | 78 const nacl::PnaclCacheInfo& cache_info, |
79 const NexeFdCallback& cb); | 79 const NexeFdCallback& cb); |
80 | 80 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; | 178 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; |
179 PendingTranslationMap pending_translations_; | 179 PendingTranslationMap pending_translations_; |
180 base::ThreadChecker thread_checker_; | 180 base::ThreadChecker thread_checker_; |
181 base::WeakPtrFactory<PnaclHost> weak_factory_; | 181 base::WeakPtrFactory<PnaclHost> weak_factory_; |
182 DISALLOW_COPY_AND_ASSIGN(PnaclHost); | 182 DISALLOW_COPY_AND_ASSIGN(PnaclHost); |
183 }; | 183 }; |
184 | 184 |
185 } // namespace pnacl | 185 } // namespace pnacl |
186 | 186 |
187 #endif // COMPONENTS_NACL_BROWSER_PNACL_HOST_H_ | 187 #endif // COMPONENTS_NACL_BROWSER_PNACL_HOST_H_ |
OLD | NEW |