| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/public/browser/tracing_controller.h" | 5 #include "content/public/browser/tracing_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 const char* kMetadataWhitelist[] = { | 32 const char* kMetadataWhitelist[] = { |
| 33 "cpu-brand", | 33 "cpu-brand", |
| 34 "network-type", | 34 "network-type", |
| 35 "os-name", | 35 "os-name", |
| 36 "user-agent" | 36 "user-agent" |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 bool IsMetadataWhitelisted(const std::string& metadata_name) { | 39 bool IsMetadataWhitelisted(const std::string& metadata_name) { |
| 40 for (auto key : kMetadataWhitelist) { | 40 for (auto* key : kMetadataWhitelist) { |
| 41 if (base::MatchPattern(metadata_name, key)) { | 41 if (base::MatchPattern(metadata_name, key)) { |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool IsTraceEventArgsWhitelisted( | 48 bool IsTraceEventArgsWhitelisted( |
| 49 const char* category_group_name, | 49 const char* category_group_name, |
| 50 const char* event_name, | 50 const char* event_name, |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 TracingController* controller = TracingController::GetInstance(); | 436 TracingController* controller = TracingController::GetInstance(); |
| 437 EXPECT_TRUE(controller->StartTracing( | 437 EXPECT_TRUE(controller->StartTracing( |
| 438 TraceConfig(), | 438 TraceConfig(), |
| 439 TracingController::StartTracingDoneCallback())); | 439 TracingController::StartTracingDoneCallback())); |
| 440 EXPECT_TRUE(controller->StopTracing(NULL)); | 440 EXPECT_TRUE(controller->StopTracing(NULL)); |
| 441 base::RunLoop().RunUntilIdle(); | 441 base::RunLoop().RunUntilIdle(); |
| 442 } | 442 } |
| 443 | 443 |
| 444 } // namespace content | 444 } // namespace content |
| OLD | NEW |