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

Side by Side Diff: content/browser/devtools/protocol/tracing_handler.cc

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Rebase Created 3 years, 8 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
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 #include "content/browser/devtools/protocol/tracing_handler.h" 5 #include "content/browser/devtools/protocol/tracing_handler.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 out_dict->Set(ConvertFromCamelCase(it.key(), '_'), 56 out_dict->Set(ConvertFromCamelCase(it.key(), '_'),
57 ConvertDictKeyStyle(it.value())); 57 ConvertDictKeyStyle(it.value()));
58 } 58 }
59 return std::move(out_dict); 59 return std::move(out_dict);
60 } 60 }
61 61
62 const base::ListValue* list = nullptr; 62 const base::ListValue* list = nullptr;
63 if (value.GetAsList(&list)) { 63 if (value.GetAsList(&list)) {
64 std::unique_ptr<base::ListValue> out_list(new base::ListValue()); 64 std::unique_ptr<base::ListValue> out_list(new base::ListValue());
65 for (const auto& value : *list) 65 for (const auto& value : *list)
66 out_list->Append(ConvertDictKeyStyle(*value)); 66 out_list->Append(ConvertDictKeyStyle(value));
67 return std::move(out_list); 67 return std::move(out_list);
68 } 68 }
69 69
70 return value.CreateDeepCopy(); 70 return value.CreateDeepCopy();
71 } 71 }
72 72
73 class DevToolsTraceSinkProxy : public TracingController::TraceDataSink { 73 class DevToolsTraceSinkProxy : public TracingController::TraceDataSink {
74 public: 74 public:
75 explicit DevToolsTraceSinkProxy(base::WeakPtr<TracingHandler> handler) 75 explicit DevToolsTraceSinkProxy(base::WeakPtr<TracingHandler> handler)
76 : tracing_handler_(handler) {} 76 : tracing_handler_(handler) {}
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 359
360 std::string mode; 360 std::string mode;
361 if (tracing_dict->GetString(kRecordModeParam, &mode)) 361 if (tracing_dict->GetString(kRecordModeParam, &mode))
362 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); 362 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-'));
363 363
364 return base::trace_event::TraceConfig(*tracing_dict); 364 return base::trace_event::TraceConfig(*tracing_dict);
365 } 365 }
366 366
367 } // namespace tracing 367 } // namespace tracing
368 } // namespace protocol 368 } // namespace protocol
OLDNEW
« no previous file with comments | « content/browser/browsing_data/clear_site_data_throttle.cc ('k') | content/browser/tracing/background_tracing_config_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698