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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 bool got_cache_hit; | 118 bool got_cache_hit; |
119 bool is_incognito; | 119 bool is_incognito; |
120 scoped_refptr<net::DrainableIOBuffer> nexe_read_buffer; | 120 scoped_refptr<net::DrainableIOBuffer> nexe_read_buffer; |
121 NexeFdCallback callback; | 121 NexeFdCallback callback; |
122 std::string cache_key; | 122 std::string cache_key; |
123 nacl::PnaclCacheInfo cache_info; | 123 nacl::PnaclCacheInfo cache_info; |
124 }; | 124 }; |
125 | 125 |
126 typedef std::pair<int, int> TranslationID; | 126 typedef std::pair<int, int> TranslationID; |
127 typedef std::map<TranslationID, PendingTranslation> PendingTranslationMap; | 127 typedef std::map<TranslationID, PendingTranslation> PendingTranslationMap; |
| 128 static bool TranslationMayBeCached( |
| 129 const PendingTranslationMap::iterator& entry); |
128 | 130 |
129 void InitForTest(base::FilePath temp_dir); | 131 void InitForTest(base::FilePath temp_dir); |
130 void OnCacheInitialized(int net_error); | 132 void OnCacheInitialized(int net_error); |
131 | 133 |
132 static void DoCreateTemporaryFile(base::FilePath temp_dir_, | 134 static void DoCreateTemporaryFile(base::FilePath temp_dir_, |
133 TempFileCallback cb); | 135 TempFileCallback cb); |
134 | 136 |
135 // GetNexeFd common steps | 137 // GetNexeFd common steps |
136 void SendCacheQueryAndTempFileRequest(const std::string& key, | 138 void SendCacheQueryAndTempFileRequest(const std::string& key, |
137 const TranslationID& id); | 139 const TranslationID& id); |
(...skipping 22 matching lines...) Expand all Loading... |
160 CacheState cache_state_; | 162 CacheState cache_state_; |
161 base::FilePath temp_dir_; | 163 base::FilePath temp_dir_; |
162 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; | 164 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; |
163 PendingTranslationMap pending_translations_; | 165 PendingTranslationMap pending_translations_; |
164 base::ThreadChecker thread_checker_; | 166 base::ThreadChecker thread_checker_; |
165 base::WeakPtrFactory<PnaclHost> weak_factory_; | 167 base::WeakPtrFactory<PnaclHost> weak_factory_; |
166 DISALLOW_COPY_AND_ASSIGN(PnaclHost); | 168 DISALLOW_COPY_AND_ASSIGN(PnaclHost); |
167 }; | 169 }; |
168 | 170 |
169 #endif // CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ | 171 #endif // CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ |
OLD | NEW |