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

Side by Side Diff: webrtc/modules/audio_processing/test/protobuf_utils.cc

Issue 2786363002: Revert of Loosening the coupling between WebRTC and //third_party/protobuf (Closed)
Patch Set: 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
« no previous file with comments | « webrtc/modules/audio_processing/test/protobuf_utils.h ('k') | webrtc/tools/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 12 matching lines...) Expand all
23 if (fread(&size, sizeof(size), 1, file) != 1) 23 if (fread(&size, sizeof(size), 1, file) != 1)
24 return 0; 24 return 0;
25 if (size <= 0) 25 if (size <= 0)
26 return 0; 26 return 0;
27 27
28 bytes->reset(new uint8_t[size]); 28 bytes->reset(new uint8_t[size]);
29 return fread(bytes->get(), sizeof((*bytes)[0]), size, file); 29 return fread(bytes->get(), sizeof((*bytes)[0]), size, file);
30 } 30 }
31 31
32 // Returns true on success, false on error or end-of-file. 32 // Returns true on success, false on error or end-of-file.
33 bool ReadMessageFromFile(FILE* file, MessageLite* msg) { 33 bool ReadMessageFromFile(FILE* file, ::google::protobuf::MessageLite* msg) {
34 std::unique_ptr<uint8_t[]> bytes; 34 std::unique_ptr<uint8_t[]> bytes;
35 size_t size = ReadMessageBytesFromFile(file, &bytes); 35 size_t size = ReadMessageBytesFromFile(file, &bytes);
36 if (!size) 36 if (!size)
37 return false; 37 return false;
38 38
39 msg->Clear(); 39 msg->Clear();
40 return msg->ParseFromArray(bytes.get(), size); 40 return msg->ParseFromArray(bytes.get(), size);
41 } 41 }
42 42
43 } // namespace webrtc 43 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/test/protobuf_utils.h ('k') | webrtc/tools/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698