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

Side by Side Diff: src/inspector/string-16.cc

Issue 2450653002: [inspector] enable inspector by default (Closed)
Patch Set: disable debugger after test Created 4 years, 1 month 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/d8.cc ('k') | test/inspector/protocol-test.js » ('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/string-16.h" 5 #include "src/inspector/string-16.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cctype> 8 #include <cctype>
9 #include <cstdlib> 9 #include <cstdlib>
10 #include <cstring> 10 #include <cstring>
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 const size_t kBufferSize = 50; 370 const size_t kBufferSize = 50;
371 char buffer[kBufferSize]; 371 char buffer[kBufferSize];
372 v8::base::OS::SNPrintF(buffer, kBufferSize, "%d", number); 372 v8::base::OS::SNPrintF(buffer, kBufferSize, "%d", number);
373 return String16(buffer); 373 return String16(buffer);
374 } 374 }
375 375
376 // static 376 // static
377 String16 String16::fromInteger(size_t number) { 377 String16 String16::fromInteger(size_t number) {
378 const size_t kBufferSize = 50; 378 const size_t kBufferSize = 50;
379 char buffer[kBufferSize]; 379 char buffer[kBufferSize];
380 #if !defined(_WIN32) && !defined(_WIN64)
380 v8::base::OS::SNPrintF(buffer, kBufferSize, "%zu", number); 381 v8::base::OS::SNPrintF(buffer, kBufferSize, "%zu", number);
382 #else
383 v8::base::OS::SNPrintF(buffer, kBufferSize, "%Iu", number);
384 #endif
381 return String16(buffer); 385 return String16(buffer);
382 } 386 }
383 387
384 // static 388 // static
385 String16 String16::fromDouble(double number) { 389 String16 String16::fromDouble(double number) {
386 std::ostringstream s; 390 std::ostringstream s;
387 s.imbue(std::locale("C")); 391 s.imbue(std::locale("C"));
388 s << std::fixed << std::setprecision(std::numeric_limits<double>::digits10) 392 s << std::fixed << std::setprecision(std::numeric_limits<double>::digits10)
389 << number; 393 << number;
390 return String16(s.str().c_str()); 394 return String16(s.str().c_str());
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 // There should be room left, since one UChar hasn't been 513 // There should be room left, since one UChar hasn't been
510 // converted. 514 // converted.
511 DCHECK((buffer + 3) <= (buffer + bufferVector.size())); 515 DCHECK((buffer + 3) <= (buffer + bufferVector.size()));
512 putUTF8Triple(buffer, *characters); 516 putUTF8Triple(buffer, *characters);
513 } 517 }
514 518
515 return std::string(bufferVector.data(), buffer - bufferVector.data()); 519 return std::string(bufferVector.data(), buffer - bufferVector.data());
516 } 520 }
517 521
518 } // namespace v8_inspector 522 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | test/inspector/protocol-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698