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

Side by Side Diff: base/i18n/streaming_utf8_validator_perftest.cc

Issue 1542323002: Switch to standard integer types in base/i18n/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: header Created 4 years, 12 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 | « base/i18n/streaming_utf8_validator.cc ('k') | base/i18n/streaming_utf8_validator_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // All data that is passed through a WebSocket with type "Text" needs to be 5 // All data that is passed through a WebSocket with type "Text" needs to be
6 // validated as UTF8. Since this is done on the IO thread, it needs to be 6 // validated as UTF8. Since this is done on the IO thread, it needs to be
7 // reasonably fast. 7 // reasonably fast.
8 8
9 // We are only interested in the performance on valid UTF8. Invalid UTF8 will 9 // We are only interested in the performance on valid UTF8. Invalid UTF8 will
10 // result in a connection failure, so is unlikely to become a source of 10 // result in a connection failure, so is unlikely to become a source of
11 // performance issues. 11 // performance issues.
12 12
13 #include "base/i18n/streaming_utf8_validator.h" 13 #include "base/i18n/streaming_utf8_validator.h"
14 14
15 #include <stddef.h>
16
15 #include <string> 17 #include <string>
16 18
17 #include "base/basictypes.h"
18 #include "base/bind.h" 19 #include "base/bind.h"
19 #include "base/callback.h" 20 #include "base/callback.h"
21 #include "base/macros.h"
20 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
21 #include "base/strings/stringprintf.h" 23 #include "base/strings/stringprintf.h"
22 #include "base/test/perf_time_logger.h" 24 #include "base/test/perf_time_logger.h"
23 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
24 26
25 namespace base { 27 namespace base {
26 namespace { 28 namespace {
27 29
28 // We want to test ranges of valid UTF-8 sequences. These ranges are inclusive. 30 // We want to test ranges of valid UTF-8 sequences. These ranges are inclusive.
29 // They are intended to be large enough that the validator needs to do 31 // They are intended to be large enough that the validator needs to do
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 RunSomeTests("%s: bytes=4 ranged length=%d repeat=%d", 231 RunSomeTests("%s: bytes=4 ranged length=%d repeat=%d",
230 base::Bind(ConstructRangedTestString, 232 base::Bind(ConstructRangedTestString,
231 kFourByteSeqRangeStart, 233 kFourByteSeqRangeStart,
232 kFourByteSeqRangeEnd), 234 kFourByteSeqRangeEnd),
233 kTestFunctions, 235 kTestFunctions,
234 2); 236 2);
235 } 237 }
236 238
237 } // namespace 239 } // namespace
238 } // namespace base 240 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/streaming_utf8_validator.cc ('k') | base/i18n/streaming_utf8_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698