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

Side by Side Diff: third_party/protobuf/patches/0003-remove-static-initializers.patch

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 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
OLDNEW
(Empty)
1 unchanged:
2 --- protobuf-cleaned/src/google/protobuf/stubs/status.cc 2015-12-30 13:21 :46.000000000 -0800
3 +++ protobuf-patched/src/google/protobuf/stubs/status.cc 2016-03-31 13:25 :40.888006485 -0700
4 @@ -82,9 +82,9 @@
5 }
6 } // namespace error.
7
8 -const Status Status::OK = Status();
9 -const Status Status::CANCELLED = Status(error::CANCELLED, "");
10 -const Status Status::UNKNOWN = Status(error::UNKNOWN, "");
11 +const StatusPod Status::OK = { error::OK };
12 +const StatusPod Status::CANCELLED = { error::CANCELLED };
13 +const StatusPod Status::UNKNOWN = { error::UNKNOWN };
14
15 Status::Status() : error_code_(error::OK) {
16 }
17 @@ -100,6 +100,9 @@
18 : error_code_(other.error_code_), error_message_(other.error_message_) {
19 }
20
21 +Status::Status(const StatusPod& status_pod) : error_code_(status_pod.code) {
22 +}
23 +
24 Status& Status::operator=(const Status& other) {
25 error_code_ = other.error_code_;
26 error_message_ = other.error_message_;
27 unchanged:
28 --- protobuf-cleaned/src/google/protobuf/stubs/status.h 2015-12-30 13:21:46.0000 00000 -0800
29 +++ protobuf-patched/src/google/protobuf/stubs/status.h 2016-03-31 13:25:40.8880 06485 -0700
30 @@ -62,6 +62,10 @@
31 };
32 } // namespace error
33
34 +struct StatusPod {
35 + error::Code code;
36 +};
37 +
38 class LIBPROTOBUF_EXPORT Status {
39 public:
40 // Creates a "successful" status.
41 @@ -73,13 +77,14 @@
42 // constructed.
43 Status(error::Code error_code, StringPiece error_message);
44 Status(const Status&);
45 + Status(const StatusPod&);
46 Status& operator=(const Status& x);
47 ~Status() {}
48
49 // Some pre-defined Status objects
50 - static const Status OK; // Identical to 0-arg constructor
51 - static const Status CANCELLED;
52 - static const Status UNKNOWN;
53 + static const StatusPod OK;
54 + static const StatusPod CANCELLED;
55 + static const StatusPod UNKNOWN;
56
57 // Accessor
58 bool ok() const {
59 only in patch2:
60 unchanged:
61 --- protobuf-cleaned/src/google/protobuf/stubs/int128.cc 2015-12-30 13:21 :46.000000000 -0800
62 +++ protobuf-patched/src/google/protobuf/stubs/int128.cc 2016-03-31 13:25 :40.888006485 -0700
63 @@ -31,7 +31,7 @@
64 #include <google/protobuf/stubs/int128.h>
65
66 #include <iomanip>
67 -#include <iostream> // NOLINT(readability/streams)
68 +#include <ostream> // NOLINT(readability/streams)
69 #include <sstream>
70
71 namespace google {
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698