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 CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ | 5 #ifndef CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ |
6 #define CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ | 6 #define CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // TranslationFinished after it finishes translation to allow the nexe to be | 56 // TranslationFinished after it finishes translation to allow the nexe to be |
57 // stored in the cache. | 57 // stored in the cache. |
58 void GetNexeFd(int render_process_id, | 58 void GetNexeFd(int render_process_id, |
59 base::ProcessHandle process_handle, | 59 base::ProcessHandle process_handle, |
60 int render_view_id, | 60 int render_view_id, |
61 int pp_instance, | 61 int pp_instance, |
62 const nacl::PnaclCacheInfo& cache_info, | 62 const nacl::PnaclCacheInfo& cache_info, |
63 const NexeFdCallback& cb); | 63 const NexeFdCallback& cb); |
64 | 64 |
65 // Called after the translation of a pexe instance identified by | 65 // Called after the translation of a pexe instance identified by |
66 // |render_process_id| and |pp_instance| finishes. Store the nexe translated | 66 // |render_process_id| and |pp_instance| finishes. If |success| is true, |
67 // for the instance in the cache. | 67 // store the nexe translated for the instance in the cache. |
68 void TranslationFinished(int render_process_id, int pp_instance); | 68 void TranslationFinished(int render_process_id, |
| 69 int pp_instance, |
| 70 bool success); |
69 | 71 |
70 // Called when the renderer identified by |render_process_id| is closing. | 72 // Called when the renderer identified by |render_process_id| is closing. |
71 // Clean up any outstanding translations for that renderer. | 73 // Clean up any outstanding translations for that renderer. |
72 void RendererClosing(int render_process_id); | 74 void RendererClosing(int render_process_id); |
73 | 75 |
74 private: | 76 private: |
75 // PnaclHost is a singleton because there is only one translation cache, and | 77 // PnaclHost is a singleton because there is only one translation cache, and |
76 // so that the BrowsingDataRemover can clear it even if no translation has | 78 // so that the BrowsingDataRemover can clear it even if no translation has |
77 // ever been started. | 79 // ever been started. |
78 friend struct DefaultSingletonTraits<PnaclHost>; | 80 friend struct DefaultSingletonTraits<PnaclHost>; |
(...skipping 26 matching lines...) Expand all Loading... |
105 CacheState cache_state_; | 107 CacheState cache_state_; |
106 base::FilePath temp_dir_; | 108 base::FilePath temp_dir_; |
107 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; | 109 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; |
108 PendingTranslationMap pending_translations_; | 110 PendingTranslationMap pending_translations_; |
109 base::ThreadChecker thread_checker_; | 111 base::ThreadChecker thread_checker_; |
110 base::WeakPtrFactory<PnaclHost> weak_factory_; | 112 base::WeakPtrFactory<PnaclHost> weak_factory_; |
111 DISALLOW_COPY_AND_ASSIGN(PnaclHost); | 113 DISALLOW_COPY_AND_ASSIGN(PnaclHost); |
112 }; | 114 }; |
113 | 115 |
114 #endif // CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ | 116 #endif // CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ |
OLD | NEW |