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

Side by Side Diff: chrome/test/chromedriver/chrome/log.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « chrome/test/chromedriver/alert_commands.cc ('k') | chrome/test/chromedriver/commands.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 (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 "chrome/test/chromedriver/chrome/log.h" 5 #include "chrome/test/chromedriver/chrome/log.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 continue; 65 continue;
66 if (list_copy->GetSize() >= kMaxChildren - 1) { 66 if (list_copy->GetSize() >= kMaxChildren - 1) {
67 list_copy->AppendString("..."); 67 list_copy->AppendString("...");
68 break; 68 break;
69 } 69 }
70 list_copy->Append(SmartDeepCopy(child)); 70 list_copy->Append(SmartDeepCopy(child));
71 } 71 }
72 return std::move(list_copy); 72 return std::move(list_copy);
73 } else if (value->GetAsString(&data)) { 73 } else if (value->GetAsString(&data)) {
74 TruncateString(&data); 74 TruncateString(&data);
75 return std::unique_ptr<base::Value>(new base::StringValue(data)); 75 return std::unique_ptr<base::Value>(new base::Value(data));
76 } 76 }
77 return std::unique_ptr<base::Value>(value->DeepCopy()); 77 return std::unique_ptr<base::Value>(value->DeepCopy());
78 } 78 }
79 79
80 } // namespace 80 } // namespace
81 81
82 void InitLogging(IsVLogOnFunc is_vlog_on_func) { 82 void InitLogging(IsVLogOnFunc is_vlog_on_func) {
83 g_is_vlog_on_func = is_vlog_on_func; 83 g_is_vlog_on_func = is_vlog_on_func;
84 } 84 }
85 85
(...skipping 17 matching lines...) Expand all
103 } 103 }
104 104
105 std::string FormatValueForDisplay(const base::Value& value) { 105 std::string FormatValueForDisplay(const base::Value& value) {
106 std::unique_ptr<base::Value> copy(SmartDeepCopy(&value)); 106 std::unique_ptr<base::Value> copy(SmartDeepCopy(&value));
107 return PrettyPrintValue(*copy); 107 return PrettyPrintValue(*copy);
108 } 108 }
109 109
110 std::string FormatJsonForDisplay(const std::string& json) { 110 std::string FormatJsonForDisplay(const std::string& json) {
111 std::unique_ptr<base::Value> value = base::JSONReader::Read(json); 111 std::unique_ptr<base::Value> value = base::JSONReader::Read(json);
112 if (!value) 112 if (!value)
113 value.reset(new base::StringValue(json)); 113 value.reset(new base::Value(json));
114 return FormatValueForDisplay(*value); 114 return FormatValueForDisplay(*value);
115 } 115 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/alert_commands.cc ('k') | chrome/test/chromedriver/commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698