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

Side by Side Diff: minidump/minidump_string_writer.h

Issue 896663006: win: Resolve zero-length array errors on MSVC (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump-comp
Patch Set: fixes Created 5 years, 10 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 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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ 15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_
16 #define CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ 16 #define CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_
17 17
18 #include <windows.h> 18 #include <windows.h>
19 #include <dbghelp.h> 19 #include <dbghelp.h>
20 20
21 #include <string> 21 #include <string>
22 #include <vector> 22 #include <vector>
23 23
24 #include "base/basictypes.h" 24 #include "base/basictypes.h"
25 #include "base/memory/scoped_ptr.h"
25 #include "base/strings/string16.h" 26 #include "base/strings/string16.h"
26 #include "minidump/minidump_extensions.h" 27 #include "minidump/minidump_extensions.h"
27 #include "minidump/minidump_rva_list_writer.h" 28 #include "minidump/minidump_rva_list_writer.h"
28 #include "minidump/minidump_writable.h" 29 #include "minidump/minidump_writable.h"
29 30
30 namespace crashpad { 31 namespace crashpad {
31 namespace internal { 32 namespace internal {
32 33
33 //! \cond 34 //! \cond
34 35
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 //! 69 //!
69 //! \note Valid in #kStateMutable. 70 //! \note Valid in #kStateMutable.
70 void set_string(const StringType& string) { string_.assign(string); } 71 void set_string(const StringType& string) { string_.assign(string); }
71 72
72 //! \brief Retrieves the string to be written. 73 //! \brief Retrieves the string to be written.
73 //! 74 //!
74 //! \note Valid in any state. 75 //! \note Valid in any state.
75 const StringType& string() const { return string_; } 76 const StringType& string() const { return string_; }
76 77
77 private: 78 private:
78 MinidumpStringType string_base_; 79 scoped_ptr<MinidumpStringType> string_base_;
79 StringType string_; 80 StringType string_;
80 81
81 DISALLOW_COPY_AND_ASSIGN(MinidumpStringWriter); 82 DISALLOW_COPY_AND_ASSIGN(MinidumpStringWriter);
82 }; 83 };
83 84
84 //! \brief Writes a variable-length UTF-16-encoded MINIDUMP_STRING to a minidump 85 //! \brief Writes a variable-length UTF-16-encoded MINIDUMP_STRING to a minidump
85 //! file. 86 //! file.
86 //! 87 //!
87 //! MinidumpUTF16StringWriter objects should not be instantiated directly 88 //! MinidumpUTF16StringWriter objects should not be instantiated directly
88 //! outside of the MinidumpWritable family of classes. 89 //! outside of the MinidumpWritable family of classes.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } // namespace internal 174 } // namespace internal
174 175
175 using MinidumpUTF16StringListWriter = internal::MinidumpStringListWriter< 176 using MinidumpUTF16StringListWriter = internal::MinidumpStringListWriter<
176 internal::MinidumpUTF16StringWriter>; 177 internal::MinidumpUTF16StringWriter>;
177 using MinidumpUTF8StringListWriter = internal::MinidumpStringListWriter< 178 using MinidumpUTF8StringListWriter = internal::MinidumpStringListWriter<
178 internal::MinidumpUTF8StringWriter>; 179 internal::MinidumpUTF8StringWriter>;
179 180
180 } // namespace crashpad 181 } // namespace crashpad
181 182
182 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ 183 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_
OLDNEW
« no previous file with comments | « minidump/minidump_simple_string_dictionary_writer.cc ('k') | minidump/minidump_string_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698