| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/trace_event/trace_event.h" | 5 #include "base/trace_event/trace_event.h" | 
| 6 | 6 | 
| 7 #include <math.h> | 7 #include <math.h> | 
| 8 #include <stddef.h> | 8 #include <stddef.h> | 
| 9 #include <stdint.h> | 9 #include <stdint.h> | 
| 10 | 10 | 
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 260       continue; | 260       continue; | 
| 261     DictionaryValue* dict = static_cast<DictionaryValue*>(value); | 261     DictionaryValue* dict = static_cast<DictionaryValue*>(value); | 
| 262 | 262 | 
| 263     if (IsAllKeyValueInDict(key_values, dict)) | 263     if (IsAllKeyValueInDict(key_values, dict)) | 
| 264       return dict; | 264       return dict; | 
| 265   } | 265   } | 
| 266   return NULL; | 266   return NULL; | 
| 267 } | 267 } | 
| 268 | 268 | 
| 269 void TraceEventTestFixture::DropTracedMetadataRecords() { | 269 void TraceEventTestFixture::DropTracedMetadataRecords() { | 
| 270   std::unique_ptr<ListValue> old_trace_parsed(trace_parsed_.DeepCopy()); | 270   std::unique_ptr<ListValue> old_trace_parsed(trace_parsed_.CreateDeepCopy()); | 
| 271   size_t old_trace_parsed_size = old_trace_parsed->GetSize(); | 271   size_t old_trace_parsed_size = old_trace_parsed->GetSize(); | 
| 272   trace_parsed_.Clear(); | 272   trace_parsed_.Clear(); | 
| 273 | 273 | 
| 274   for (size_t i = 0; i < old_trace_parsed_size; i++) { | 274   for (size_t i = 0; i < old_trace_parsed_size; i++) { | 
| 275     Value* value = NULL; | 275     Value* value = nullptr; | 
| 276     old_trace_parsed->Get(i, &value); | 276     old_trace_parsed->Get(i, &value); | 
| 277     if (!value || value->GetType() != Value::TYPE_DICTIONARY) { | 277     if (!value || value->GetType() != Value::TYPE_DICTIONARY) { | 
| 278       trace_parsed_.Append(value->DeepCopy()); | 278       trace_parsed_.Append(value->CreateDeepCopy()); | 
| 279       continue; | 279       continue; | 
| 280     } | 280     } | 
| 281     DictionaryValue* dict = static_cast<DictionaryValue*>(value); | 281     DictionaryValue* dict = static_cast<DictionaryValue*>(value); | 
| 282     std::string tmp; | 282     std::string tmp; | 
| 283     if (dict->GetString("ph", &tmp) && tmp == "M") | 283     if (dict->GetString("ph", &tmp) && tmp == "M") | 
| 284       continue; | 284       continue; | 
| 285 | 285 | 
| 286     trace_parsed_.Append(value->DeepCopy()); | 286     trace_parsed_.Append(value->CreateDeepCopy()); | 
| 287   } | 287   } | 
| 288 } | 288 } | 
| 289 | 289 | 
| 290 DictionaryValue* TraceEventTestFixture::FindNamePhase(const char* name, | 290 DictionaryValue* TraceEventTestFixture::FindNamePhase(const char* name, | 
| 291                                                       const char* phase) { | 291                                                       const char* phase) { | 
| 292   JsonKeyValue key_values[] = { | 292   JsonKeyValue key_values[] = { | 
| 293     {"name", name, IS_EQUAL}, | 293     {"name", name, IS_EQUAL}, | 
| 294     {"ph", phase, IS_EQUAL}, | 294     {"ph", phase, IS_EQUAL}, | 
| 295     {0, 0, IS_EQUAL} | 295     {0, 0, IS_EQUAL} | 
| 296   }; | 296   }; | 
| (...skipping 2797 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3094 } | 3094 } | 
| 3095 | 3095 | 
| 3096 TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationToString) { | 3096 TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationToString) { | 
| 3097   const char filter[] = "DELAY(test.Delay;16;oneshot)"; | 3097   const char filter[] = "DELAY(test.Delay;16;oneshot)"; | 
| 3098   TraceConfig config(filter, ""); | 3098   TraceConfig config(filter, ""); | 
| 3099   EXPECT_EQ(filter, config.ToCategoryFilterString()); | 3099   EXPECT_EQ(filter, config.ToCategoryFilterString()); | 
| 3100 } | 3100 } | 
| 3101 | 3101 | 
| 3102 }  // namespace trace_event | 3102 }  // namespace trace_event | 
| 3103 }  // namespace base | 3103 }  // namespace base | 
| OLD | NEW | 
|---|