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

Side by Side Diff: minidump/minidump_string_writer.cc

Issue 699313007: minidump: Use the crashpad::internal namespace more appropriately (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month 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 | « minidump/minidump_string_writer.h ('k') | minidump/minidump_string_writer_test.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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 void MinidumpUTF16StringWriter::SetUTF8(const std::string& string_utf8) { 89 void MinidumpUTF16StringWriter::SetUTF8(const std::string& string_utf8) {
90 DCHECK_EQ(state(), kStateMutable); 90 DCHECK_EQ(state(), kStateMutable);
91 91
92 set_string(MinidumpWriterUtil::ConvertUTF8ToUTF16(string_utf8)); 92 set_string(MinidumpWriterUtil::ConvertUTF8ToUTF16(string_utf8));
93 } 93 }
94 94
95 MinidumpUTF8StringWriter::~MinidumpUTF8StringWriter() { 95 MinidumpUTF8StringWriter::~MinidumpUTF8StringWriter() {
96 } 96 }
97 97
98 template <typename Traits> 98 template <typename MinidumpStringWriterType>
99 MinidumpStringListWriter<Traits>::MinidumpStringListWriter() 99 MinidumpStringListWriter<MinidumpStringWriterType>::MinidumpStringListWriter()
100 : MinidumpRVAListWriter() { 100 : MinidumpRVAListWriter() {
101 } 101 }
102 102
103 template <typename Traits> 103 template <typename MinidumpStringWriterType>
104 MinidumpStringListWriter<Traits>::~MinidumpStringListWriter() { 104 MinidumpStringListWriter<
105 MinidumpStringWriterType>::~MinidumpStringListWriter() {
105 } 106 }
106 107
107 template <typename Traits> 108 template <typename MinidumpStringWriterType>
108 void MinidumpStringListWriter<Traits>::InitializeFromVector( 109 void MinidumpStringListWriter<MinidumpStringWriterType>::InitializeFromVector(
109 const std::vector<std::string>& vector) { 110 const std::vector<std::string>& vector) {
110 DCHECK_EQ(state(), kStateMutable); 111 DCHECK_EQ(state(), kStateMutable);
111 DCHECK(IsEmpty()); 112 DCHECK(IsEmpty());
112 113
113 for (const std::string& string : vector) { 114 for (const std::string& string : vector) {
114 AddStringUTF8(string); 115 AddStringUTF8(string);
115 } 116 }
116 } 117 }
117 118
118 template <typename Traits> 119 template <typename MinidumpStringWriterType>
119 void MinidumpStringListWriter<Traits>::AddStringUTF8( 120 void MinidumpStringListWriter<MinidumpStringWriterType>::AddStringUTF8(
120 const std::string& string_utf8) { 121 const std::string& string_utf8) {
121 auto string_writer = make_scoped_ptr(new MinidumpStringWriterType()); 122 auto string_writer = make_scoped_ptr(new MinidumpStringWriterType());
122 string_writer->SetUTF8(string_utf8); 123 string_writer->SetUTF8(string_utf8);
123 AddChild(string_writer.Pass()); 124 AddChild(string_writer.Pass());
124 } 125 }
125 126
126 template <typename Traits> 127 template <typename MinidumpStringWriterType>
127 bool MinidumpStringListWriter<Traits>::IsUseful() const { 128 bool MinidumpStringListWriter<MinidumpStringWriterType>::IsUseful() const {
128 return !IsEmpty(); 129 return !IsEmpty();
129 } 130 }
130 131
131 // Explicit template instantiation of the forms of MinidumpStringListWriter<> 132 // Explicit template instantiation of the forms of MinidumpStringListWriter<>
132 // used as type aliases. 133 // used as type aliases.
133 template class MinidumpStringListWriter<MinidumpStringListWriterUTF16Traits>; 134 template class MinidumpStringListWriter<MinidumpUTF16StringWriter>;
134 template class MinidumpStringListWriter<MinidumpStringListWriterUTF8Traits>; 135 template class MinidumpStringListWriter<MinidumpUTF8StringWriter>;
135 136
136 } // namespace internal 137 } // namespace internal
137 } // namespace crashpad 138 } // namespace crashpad
OLDNEW
« no previous file with comments | « minidump/minidump_string_writer.h ('k') | minidump/minidump_string_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698