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

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

Issue 2828933002: [console] fast console.assert(true) (Closed)
Patch Set: addressed comments Created 3 years, 8 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/code-stub-assembler.h ('k') | src/v8.gyp » ('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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 int count = 272 int count =
273 helper.consoleMessageStorage()->count(helper.contextId(), identifier); 273 helper.consoleMessageStorage()->count(helper.contextId(), identifier);
274 String16 countString = String16::fromInteger(count); 274 String16 countString = String16::fromInteger(count);
275 helper.reportCallWithArgument( 275 helper.reportCallWithArgument(
276 ConsoleAPIType::kCount, 276 ConsoleAPIType::kCount,
277 title.isEmpty() ? countString : (title + ": " + countString)); 277 title.isEmpty() ? countString : (title + ": " + countString));
278 } 278 }
279 279
280 void V8Console::Assert(const v8::debug::ConsoleCallArguments& info) { 280 void V8Console::Assert(const v8::debug::ConsoleCallArguments& info) {
281 ConsoleHelper helper(info, m_inspector); 281 ConsoleHelper helper(info, m_inspector);
282 if (helper.firstArgToBoolean(false)) return; 282 DCHECK(!helper.firstArgToBoolean(false));
283 283
284 std::vector<v8::Local<v8::Value>> arguments; 284 std::vector<v8::Local<v8::Value>> arguments;
285 for (int i = 1; i < info.Length(); ++i) arguments.push_back(info[i]); 285 for (int i = 1; i < info.Length(); ++i) arguments.push_back(info[i]);
286 if (info.Length() < 2) 286 if (info.Length() < 2)
287 arguments.push_back( 287 arguments.push_back(
288 toV8String(m_inspector->isolate(), String16("console.assert"))); 288 toV8String(m_inspector->isolate(), String16("console.assert")));
289 helper.reportCall(ConsoleAPIType::kAssert, arguments); 289 helper.reportCall(ConsoleAPIType::kAssert, arguments);
290 290
291 if (V8DebuggerAgentImpl* debuggerAgent = helper.debuggerAgent()) 291 if (V8DebuggerAgentImpl* debuggerAgent = helper.debuggerAgent())
292 debuggerAgent->breakProgramOnException( 292 debuggerAgent->breakProgramOnException(
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 ->GetOwnPropertyDescriptor( 751 ->GetOwnPropertyDescriptor(
752 m_context, v8::Local<v8::String>::Cast(name)) 752 m_context, v8::Local<v8::String>::Cast(name))
753 .ToLocal(&descriptor); 753 .ToLocal(&descriptor);
754 DCHECK(success); 754 DCHECK(success);
755 USE(success); 755 USE(success);
756 } 756 }
757 } 757 }
758 } 758 }
759 759
760 } // namespace v8_inspector 760 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698