Index: src/inspector/v8-console.cc |
diff --git a/src/inspector/v8-console.cc b/src/inspector/v8-console.cc |
index e33e25a80deb3efc54f171d92216acf5bac2f1bf..8824b9fc62cc884e9846b6f64916db148c670305 100644 |
--- a/src/inspector/v8-console.cc |
+++ b/src/inspector/v8-console.cc |
@@ -336,8 +336,14 @@ void V8Console::groupEndCallback( |
} |
void V8Console::clearCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
- ConsoleHelper(info).reportCallWithDefaultArgument(ConsoleAPIType::kClear, |
- String16("console.clear")); |
+ ConsoleHelper helper(info); |
+ InspectedContext* context = helper.ensureInspectedContext(); |
+ if (!context) return; |
+ int contextGroupId = context->contextGroupId(); |
+ if (V8InspectorClient* client = helper.ensureDebuggerClient()) |
+ client->consoleClear(contextGroupId); |
+ helper.reportCallWithDefaultArgument(ConsoleAPIType::kClear, |
+ String16("console.clear")); |
} |
void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |