Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: chrome/browser/nacl_host/pnacl_host.h

Issue 23737002: Use sequenced blocking pool task to create PNaCl's nexe temp file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fuuuuuuuu rietveld Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/nacl_host/pnacl_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/nacl_host/pnacl_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698