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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp

Issue 2226863003: [DevTools] Reduce API surface of String16. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium 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 "platform/v8_inspector/V8Console.h" 5 #include "platform/v8_inspector/V8Console.h"
6 6
7 #include "platform/inspector_protocol/Platform.h" 7 #include "platform/inspector_protocol/Platform.h"
8 #include "platform/inspector_protocol/String16.h" 8 #include "platform/inspector_protocol/String16.h"
9 #include "platform/v8_inspector/InjectedScript.h" 9 #include "platform/v8_inspector/InjectedScript.h"
10 #include "platform/v8_inspector/InspectedContext.h" 10 #include "platform/v8_inspector/InspectedContext.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 if (V8InspectorClient* client = helper.ensureDebuggerClient()) { 432 if (V8InspectorClient* client = helper.ensureDebuggerClient()) {
433 String16 protocolTitle = helper.firstArgToString("default"); 433 String16 protocolTitle = helper.firstArgToString("default");
434 if (timelinePrefix) 434 if (timelinePrefix)
435 protocolTitle = "Timeline '" + protocolTitle + "'"; 435 protocolTitle = "Timeline '" + protocolTitle + "'";
436 client->consoleTimeEnd(protocolTitle); 436 client->consoleTimeEnd(protocolTitle);
437 437
438 v8::Local<v8::Map> timeMap; 438 v8::Local<v8::Map> timeMap;
439 if (!helper.privateMap("V8Console#timeMap").ToLocal(&timeMap)) 439 if (!helper.privateMap("V8Console#timeMap").ToLocal(&timeMap))
440 return; 440 return;
441 double elapsed = client->currentTimeMS() - helper.getDoubleFromMap(timeM ap, protocolTitle, 0.0); 441 double elapsed = client->currentTimeMS() - helper.getDoubleFromMap(timeM ap, protocolTitle, 0.0);
442 String16 message = protocolTitle + ": " + String16::fromDoubleFixedPreci sion(elapsed, 3) + "ms"; 442 String16 message = protocolTitle + ": " + String16::fromDoublePrecision3 (elapsed) + "ms";
443 helper.reportCallWithArgument(ConsoleAPIType::kTimeEnd, message); 443 helper.reportCallWithArgument(ConsoleAPIType::kTimeEnd, message);
444 } 444 }
445 } 445 }
446 446
447 void V8Console::timelineCallback(const v8::FunctionCallbackInfo<v8::Value>& info ) 447 void V8Console::timelineCallback(const v8::FunctionCallbackInfo<v8::Value>& info )
448 { 448 {
449 ConsoleHelper(info).reportDeprecatedCall("V8Console#timeline", "'console.tim eline' is deprecated. Please use 'console.time' instead."); 449 ConsoleHelper(info).reportDeprecatedCall("V8Console#timeline", "'console.tim eline' is deprecated. Please use 'console.time' instead.");
450 timeFunction(info, true); 450 timeFunction(info, true);
451 } 451 }
452 452
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 continue; 823 continue;
824 if (name->IsString()) { 824 if (name->IsString()) {
825 v8::Local<v8::Value> descriptor; 825 v8::Local<v8::Value> descriptor;
826 bool success = m_global->GetOwnPropertyDescriptor(m_context, v8::Loc al<v8::String>::Cast(name)).ToLocal(&descriptor); 826 bool success = m_global->GetOwnPropertyDescriptor(m_context, v8::Loc al<v8::String>::Cast(name)).ToLocal(&descriptor);
827 DCHECK(success); 827 DCHECK(success);
828 } 828 }
829 } 829 }
830 } 830 }
831 831
832 } // namespace blink 832 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698