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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 128 |
129 void InitForTest(base::FilePath temp_dir); | 129 void InitForTest(base::FilePath temp_dir); |
130 void OnCacheInitialized(int net_error); | 130 void OnCacheInitialized(int net_error); |
131 | 131 |
132 static base::PlatformFile DoCreateTemporaryFile(base::FilePath temp_dir_); | 132 static void DoCreateTemporaryFile(base::FilePath temp_dir_, |
| 133 TempFileCallback cb); |
133 | 134 |
134 // GetNexeFd common steps | 135 // GetNexeFd common steps |
135 void SendCacheQueryAndTempFileRequest(const std::string& key, | 136 void SendCacheQueryAndTempFileRequest(const std::string& key, |
136 const TranslationID& id); | 137 const TranslationID& id); |
137 void OnCacheQueryReturn(const TranslationID& id, | 138 void OnCacheQueryReturn(const TranslationID& id, |
138 int net_error, | 139 int net_error, |
139 scoped_refptr<net::DrainableIOBuffer> buffer); | 140 scoped_refptr<net::DrainableIOBuffer> buffer); |
140 void OnTempFileReturn(const TranslationID& id, base::PlatformFile fd); | 141 void OnTempFileReturn(const TranslationID& id, base::PlatformFile fd); |
141 void CheckCacheQueryReady(const PendingTranslationMap::iterator& entry); | 142 void CheckCacheQueryReady(const PendingTranslationMap::iterator& entry); |
142 | 143 |
(...skipping 16 matching lines...) Expand all Loading... |
159 CacheState cache_state_; | 160 CacheState cache_state_; |
160 base::FilePath temp_dir_; | 161 base::FilePath temp_dir_; |
161 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; | 162 scoped_ptr<pnacl::PnaclTranslationCache> disk_cache_; |
162 PendingTranslationMap pending_translations_; | 163 PendingTranslationMap pending_translations_; |
163 base::ThreadChecker thread_checker_; | 164 base::ThreadChecker thread_checker_; |
164 base::WeakPtrFactory<PnaclHost> weak_factory_; | 165 base::WeakPtrFactory<PnaclHost> weak_factory_; |
165 DISALLOW_COPY_AND_ASSIGN(PnaclHost); | 166 DISALLOW_COPY_AND_ASSIGN(PnaclHost); |
166 }; | 167 }; |
167 | 168 |
168 #endif // CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ | 169 #endif // CHROME_BROWSER_NACL_HOST_PNACL_HOST_H_ |
OLD | NEW |