OLD | NEW |
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 #include "chrome/test/chromedriver/performance_logger.h" | 5 #include "chrome/test/chromedriver/performance_logger.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 ++i_domain) { | 45 ++i_domain) { |
46 if (base::strcasecmp(command.c_str(), kRequestTraceCommands[i_domain]) == 0) | 46 if (base::strcasecmp(command.c_str(), kRequestTraceCommands[i_domain]) == 0) |
47 return true; | 47 return true; |
48 } | 48 } |
49 return false; | 49 return false; |
50 } | 50 } |
51 | 51 |
52 // Returns whether the event belongs to one of kDomains. | 52 // Returns whether the event belongs to one of kDomains. |
53 bool ShouldLogEvent(const std::string& method) { | 53 bool ShouldLogEvent(const std::string& method) { |
54 for (size_t i_domain = 0; i_domain < arraysize(kDomains); ++i_domain) { | 54 for (size_t i_domain = 0; i_domain < arraysize(kDomains); ++i_domain) { |
55 if (base::StartsWithASCII(method, kDomains[i_domain], | 55 if (base::StartsWith(method, kDomains[i_domain], |
56 true /* case_sensitive */)) | 56 base::CompareCase::SENSITIVE)) |
57 return true; | 57 return true; |
58 } | 58 } |
59 return false; | 59 return false; |
60 } | 60 } |
61 | 61 |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 PerformanceLogger::PerformanceLogger(Log* log, const Session* session) | 64 PerformanceLogger::PerformanceLogger(Log* log, const Session* session) |
65 : log_(log), | 65 : log_(log), |
66 session_(session), | 66 session_(session), |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 if (status.IsError()) | 280 if (status.IsError()) |
281 return status; | 281 return status; |
282 | 282 |
283 return StartTrace(); | 283 return StartTrace(); |
284 } | 284 } |
285 | 285 |
286 Status PerformanceLogger::IsTraceDone(bool* trace_done) const { | 286 Status PerformanceLogger::IsTraceDone(bool* trace_done) const { |
287 *trace_done = !trace_buffering_; | 287 *trace_done = !trace_buffering_; |
288 return Status(kOk); | 288 return Status(kOk); |
289 } | 289 } |
OLD | NEW |