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

Unified Diff: src/wasm/module-compiler.h

Issue 2929853003: Fix use of history timers in background threads. (Closed)
Patch Set: Merge with master Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: src/wasm/module-compiler.h
diff --git a/src/wasm/module-compiler.h b/src/wasm/module-compiler.h
index cac664924eb141e1fc8019d6bd920bb6b9afc0f3..4c12fe091ae0778e19368db5e0529f42cb247f8a 100644
--- a/src/wasm/module-compiler.h
+++ b/src/wasm/module-compiler.h
@@ -69,8 +69,7 @@ class ModuleCompiler {
Isolate* isolate_;
std::unique_ptr<WasmModule> module_;
- std::shared_ptr<Counters> counters_shared_;
- Counters* counters_;
+ const std::shared_ptr<Counters> counters_shared_;
bool is_sync_;
std::vector<std::unique_ptr<compiler::WasmCompilationUnit>>
compilation_units_;
@@ -82,6 +81,8 @@ class ModuleCompiler {
bool finisher_is_running_ = false;
CancelableTaskManager background_task_manager_;
+ Counters* counters() const { return counters_shared_.get(); }
Mircea Trofin 2017/06/22 18:42:24 for consistency, should this have the "shared" wor
kschimpf 2017/06/22 20:38:31 This is an artifact that we used to have both fiel
+
// Run by each compilation task and by the main thread. The
// no_finisher_callback is called within the result_mutex_ lock when no
// finishing task is running, i.e. when the finisher_is_running_ flag is not
@@ -178,8 +179,7 @@ class InstanceBuilder {
Isolate* isolate_;
WasmModule* const module_;
- std::shared_ptr<Counters> counters_shared_;
- Counters* counters_;
+ const std::shared_ptr<Counters> counters_shared_;
ErrorThrower* thrower_;
Handle<WasmModuleObject> module_object_;
Handle<JSReceiver> ffi_; // TODO(titzer): Use MaybeHandle
@@ -191,6 +191,8 @@ class InstanceBuilder {
JSToWasmWrapperCache js_to_wasm_cache_;
WeakCallbackInfo<void>::Callback instance_finalizer_callback_;
+ Counters* counters() const { return counters_shared_.get(); }
+
// Helper routines to print out errors with imports.
#define ERROR_THROWER_WITH_MESSAGE(TYPE) \
void Report##TYPE(const char* error, uint32_t index, \
@@ -296,8 +298,7 @@ class AsyncCompileJob {
class FinishModule;
Isolate* isolate_;
- std::shared_ptr<Counters> counters_shared_;
- Counters* counters_;
+ const std::shared_ptr<Counters> counters_shared_;
std::unique_ptr<byte[]> bytes_copy_;
ModuleWireBytes wire_bytes_;
Handle<Context> context_;
@@ -320,6 +321,8 @@ class AsyncCompileJob {
int32_t num_pending_foreground_tasks_ = 0;
#endif
+ Counters* counters() const { return counters_shared_.get(); }
+
void ReopenHandlesInDeferredScope();
void AsyncCompileFailed(ErrorThrower& thrower);

Powered by Google App Engine
This is Rietveld 408576698