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

Side by Side Diff: src/inspector/v8-console.cc

Issue 2656613004: V8 Inspector: remove V8ConsoleAPIType from the API, reuse v8::Isolate::MessageErrorLevel instead. (Closed)
Patch Set: rebaselined the test Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/inspector/js_protocol.json ('k') | src/inspector/v8-console-message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/inspector/v8-console.h" 5 #include "src/inspector/v8-console.h"
6 6
7 #include "src/base/macros.h" 7 #include "src/base/macros.h"
8 #include "src/inspector/injected-script.h" 8 #include "src/inspector/injected-script.h"
9 #include "src/inspector/inspected-context.h" 9 #include "src/inspector/inspected-context.h"
10 #include "src/inspector/string-util.h" 10 #include "src/inspector/string-util.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 ConsoleAPIType::kStartGroupCollapsed, String16("console.groupCollapsed")); 329 ConsoleAPIType::kStartGroupCollapsed, String16("console.groupCollapsed"));
330 } 330 }
331 331
332 void V8Console::groupEndCallback( 332 void V8Console::groupEndCallback(
333 const v8::FunctionCallbackInfo<v8::Value>& info) { 333 const v8::FunctionCallbackInfo<v8::Value>& info) {
334 ConsoleHelper(info).reportCallWithDefaultArgument( 334 ConsoleHelper(info).reportCallWithDefaultArgument(
335 ConsoleAPIType::kEndGroup, String16("console.groupEnd")); 335 ConsoleAPIType::kEndGroup, String16("console.groupEnd"));
336 } 336 }
337 337
338 void V8Console::clearCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { 338 void V8Console::clearCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
339 ConsoleHelper(info).reportCallWithDefaultArgument(ConsoleAPIType::kClear, 339 ConsoleHelper helper(info);
340 String16("console.clear")); 340 InspectedContext* context = helper.ensureInspectedContext();
341 if (!context) return;
342 int contextGroupId = context->contextGroupId();
343 if (V8InspectorClient* client = helper.ensureDebuggerClient())
344 client->consoleClear(contextGroupId);
345 helper.reportCallWithDefaultArgument(ConsoleAPIType::kClear,
346 String16("console.clear"));
341 } 347 }
342 348
343 void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { 349 void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
344 ConsoleHelper helper(info); 350 ConsoleHelper helper(info);
345 351
346 String16 title = helper.firstArgToString(String16()); 352 String16 title = helper.firstArgToString(String16());
347 String16 identifier; 353 String16 identifier;
348 if (title.isEmpty()) { 354 if (title.isEmpty()) {
349 std::unique_ptr<V8StackTraceImpl> stackTrace = 355 std::unique_ptr<V8StackTraceImpl> stackTrace =
350 V8StackTraceImpl::capture(nullptr, 0, 1); 356 V8StackTraceImpl::capture(nullptr, 0, 1);
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 ->GetOwnPropertyDescriptor( 941 ->GetOwnPropertyDescriptor(
936 m_context, v8::Local<v8::String>::Cast(name)) 942 m_context, v8::Local<v8::String>::Cast(name))
937 .ToLocal(&descriptor); 943 .ToLocal(&descriptor);
938 DCHECK(success); 944 DCHECK(success);
939 USE(success); 945 USE(success);
940 } 946 }
941 } 947 }
942 } 948 }
943 949
944 } // namespace v8_inspector 950 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/inspector/js_protocol.json ('k') | src/inspector/v8-console-message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698