OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ | 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ |
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ | 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // - the size of the buffer of bytes sent but not-yet-compiled by LLC. | 81 // - the size of the buffer of bytes sent but not-yet-compiled by LLC. |
82 // - the linking time. | 82 // - the linking time. |
83 bool ShouldDelayProgressEvent() { | 83 bool ShouldDelayProgressEvent() { |
84 const uint32_t kProgressEventSlopPct = 5; | 84 const uint32_t kProgressEventSlopPct = 5; |
85 return ((expected_pexe_size_ - pexe_bytes_compiled_) * 100 / | 85 return ((expected_pexe_size_ - pexe_bytes_compiled_) * 100 / |
86 expected_pexe_size_) < kProgressEventSlopPct; | 86 expected_pexe_size_) < kProgressEventSlopPct; |
87 } | 87 } |
88 | 88 |
89 | 89 |
90 void BitcodeStreamCacheHit(PP_FileHandle handle); | 90 void BitcodeStreamCacheHit(PP_FileHandle handle); |
91 void BitcodeStreamCacheMiss(int64_t expected_pexe_size); | 91 void BitcodeStreamCacheMiss(int64_t expected_pexe_size, |
| 92 PP_FileHandle handle); |
92 | 93 |
93 // Invoked when a pexe data chunk arrives (when using streaming translation) | 94 // Invoked when a pexe data chunk arrives (when using streaming translation) |
94 void BitcodeStreamGotData(const void* data, int32_t length); | 95 void BitcodeStreamGotData(const void* data, int32_t length); |
95 | 96 |
96 // Invoked when the pexe download finishes (using streaming translation) | 97 // Invoked when the pexe download finishes (using streaming translation) |
97 void BitcodeStreamDidFinish(int32_t pp_error); | 98 void BitcodeStreamDidFinish(int32_t pp_error); |
98 | 99 |
99 private: | 100 private: |
100 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator); | 101 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator); |
101 | 102 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // The helper thread used to do translations via SRPC. | 191 // The helper thread used to do translations via SRPC. |
191 // It accesses fields of PnaclCoordinator so it must have a | 192 // It accesses fields of PnaclCoordinator so it must have a |
192 // shorter lifetime. | 193 // shorter lifetime. |
193 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_; | 194 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_; |
194 }; | 195 }; |
195 | 196 |
196 //---------------------------------------------------------------------- | 197 //---------------------------------------------------------------------- |
197 | 198 |
198 } // namespace plugin; | 199 } // namespace plugin; |
199 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ | 200 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ |
OLD | NEW |