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

Unified Diff: src/isolate.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/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index aad853dc0851fe670179a8fab4ebe720744e40a0..7a376b1a3a3003f385d7513a9a7bb814d1bae6ce 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -866,13 +866,20 @@ class Isolate {
#undef NATIVE_CONTEXT_FIELD_ACCESSOR
Bootstrapper* bootstrapper() { return bootstrapper_; }
+ // Use for updating counters on a foreground thread.
Counters* counters() {
jochen (gone - plz use gerrit) 2017/06/12 09:18:34 why not have counters() always return the shared_p
kschimpf 2017/06/12 16:47:05 Because too much code accesses it like this: C
- // Call InitializeLoggingAndCounters() if logging is needed before
- // the isolate is fully initialized.
+ DCHECK(!IsIsolateInBackground());
+ // Make sure InitializeCounters() has been called.
DCHECK_NOT_NULL(counters_shared_.get());
return counters_shared_.get();
}
- std::shared_ptr<Counters> counters_shared() { return counters_shared_; }
+ // Use for updating counters on a background thread.
+ std::shared_ptr<Counters> counters_shared() {
+ DCHECK(!IsIsolateInBackground());
+ // Make sure InitializeCounters() has been called.
+ DCHECK_NOT_NULL(counters_shared_.get());
+ return counters_shared_;
+ }
RuntimeProfiler* runtime_profiler() { return runtime_profiler_; }
CompilationCache* compilation_cache() { return compilation_cache_; }
Logger* logger() {
« src/counters.cc ('K') | « src/counters.cc ('k') | src/wasm/module-compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698