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

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

Issue 2631553003: [inspector] console.timeEnd formats ms in the same way as JS formats double (Closed)
Patch Set: fixed protocol-works-with-different-locale 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 | « no previous file | test/inspector/inspector-impl.h » ('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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 if (V8InspectorClient* client = helper.ensureDebuggerClient()) { 424 if (V8InspectorClient* client = helper.ensureDebuggerClient()) {
425 String16 protocolTitle = helper.firstArgToString("default"); 425 String16 protocolTitle = helper.firstArgToString("default");
426 if (timelinePrefix) protocolTitle = "Timeline '" + protocolTitle + "'"; 426 if (timelinePrefix) protocolTitle = "Timeline '" + protocolTitle + "'";
427 client->consoleTimeEnd(toStringView(protocolTitle)); 427 client->consoleTimeEnd(toStringView(protocolTitle));
428 428
429 v8::Local<v8::Map> timeMap; 429 v8::Local<v8::Map> timeMap;
430 if (!helper.privateMap("V8Console#timeMap").ToLocal(&timeMap)) return; 430 if (!helper.privateMap("V8Console#timeMap").ToLocal(&timeMap)) return;
431 double elapsed = client->currentTimeMS() - 431 double elapsed = client->currentTimeMS() -
432 helper.getDoubleFromMap(timeMap, protocolTitle, 0.0); 432 helper.getDoubleFromMap(timeMap, protocolTitle, 0.0);
433 String16 message = 433 String16 message =
434 protocolTitle + ": " + String16::fromDouble(elapsed, 3) + "ms"; 434 protocolTitle + ": " + String16::fromDouble(elapsed) + "ms";
435 helper.reportCallWithArgument(ConsoleAPIType::kTimeEnd, message); 435 helper.reportCallWithArgument(ConsoleAPIType::kTimeEnd, message);
436 } 436 }
437 } 437 }
438 438
439 void V8Console::timelineCallback( 439 void V8Console::timelineCallback(
440 const v8::FunctionCallbackInfo<v8::Value>& info) { 440 const v8::FunctionCallbackInfo<v8::Value>& info) {
441 ConsoleHelper(info).reportDeprecatedCall( 441 ConsoleHelper(info).reportDeprecatedCall(
442 "V8Console#timeline", 442 "V8Console#timeline",
443 "'console.timeline' is deprecated. Please use 'console.time' instead."); 443 "'console.timeline' is deprecated. Please use 'console.time' instead.");
444 timeFunction(info, true); 444 timeFunction(info, true);
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 ->GetOwnPropertyDescriptor( 935 ->GetOwnPropertyDescriptor(
936 m_context, v8::Local<v8::String>::Cast(name)) 936 m_context, v8::Local<v8::String>::Cast(name))
937 .ToLocal(&descriptor); 937 .ToLocal(&descriptor);
938 DCHECK(success); 938 DCHECK(success);
939 USE(success); 939 USE(success);
940 } 940 }
941 } 941 }
942 } 942 }
943 943
944 } // namespace v8_inspector 944 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « no previous file | test/inspector/inspector-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698