Chromium Code Reviews| 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() { |