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

Unified Diff: src/api.cc

Issue 2896303004: [inspector] Move SetIdle from CPUProfiler to debug-interface (Closed)
Patch Set: rebased Created 3 years, 7 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
« no previous file with comments | « no previous file | src/debug/debug-interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 098e3f9a83e0b168f5072fbb6c9b141bfd893928..769eb2ed239664d4191a3222ab5da6f26808fdaf 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -9642,6 +9642,18 @@ void debug::ResetBlackboxedStateCache(Isolate* v8_isolate,
}
}
+void debug::SetIdle(Isolate* v8_isolate, bool is_idle) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
+ v8::StateTag state = isolate->current_vm_state();
+ DCHECK(state == v8::EXTERNAL || state == v8::IDLE);
+ if (isolate->js_entry_sp() != NULL) return;
+ if (is_idle) {
+ isolate->set_current_vm_state(v8::IDLE);
+ } else if (state == v8::IDLE) {
+ isolate->set_current_vm_state(v8::EXTERNAL);
+ }
+}
+
int debug::EstimatedValueSize(Isolate* v8_isolate, v8::Local<v8::Value> value) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate);
@@ -10011,14 +10023,7 @@ void CpuProfiler::SetIdle(bool is_idle) {
i::CpuProfiler* profiler = reinterpret_cast<i::CpuProfiler*>(this);
i::Isolate* isolate = profiler->isolate();
if (!isolate->is_profiling()) return;
- v8::StateTag state = isolate->current_vm_state();
- DCHECK(state == v8::EXTERNAL || state == v8::IDLE);
- if (isolate->js_entry_sp() != NULL) return;
- if (is_idle) {
- isolate->set_current_vm_state(v8::IDLE);
- } else if (state == v8::IDLE) {
- isolate->set_current_vm_state(v8::EXTERNAL);
- }
+ debug::SetIdle(reinterpret_cast<v8::Isolate*>(isolate), is_idle);
}
« no previous file with comments | « no previous file | src/debug/debug-interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698