Chromium Code Reviews| Index: chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc |
| =================================================================== |
| --- chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc (revision 271871) |
| +++ chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc (working copy) |
| @@ -142,10 +142,8 @@ |
| protected: |
| std::string FormatMessage(const std::string& message) { |
| - Pickle pickle; |
| - pickle.WriteString(message); |
| - return std::string(const_cast<const Pickle*>(&pickle)->payload(), |
| - pickle.payload_size()); |
| + uint32_t length = message.length(); |
| + return std::string(reinterpret_cast<char*>(&length), 4).append(message); |
|
jar (doing other things)
2014/05/22 02:51:00
The original code is confusing for other reasons..
halyavin
2014/05/22 04:05:25
I made Pickle payload size aligned to 4 bytes and
jar (doing other things)
2014/05/23 21:22:04
Yes... SGTM. thx.
|
| } |
| base::FilePath CreateTempFileWithMessage(const std::string& message) { |