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

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 66af826b5bb8e169f86d84f5e41a5ce068f50f0f..1ad4a640d3ea52132e484a1b2cc407d0069c2a05 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -871,13 +871,20 @@ class Isolate {
#undef NATIVE_CONTEXT_FIELD_ACCESSOR
Bootstrapper* bootstrapper() { return bootstrapper_; }
+ // Use for updating counters on a foreground thread.
Counters* counters() {
- // 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() {
Mircea Trofin 2017/06/22 18:42:24 nit: shared_counters?
kschimpf 2017/06/22 20:38:31 Actually, to make clear it's context, I'll rename
+ 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() {

Powered by Google App Engine
This is Rietveld 408576698