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

Side by Side Diff: third_party/protobuf/patches/04_uninline.patch

Issue 1322483002: Revert https://codereview.chromium.org/1291903002 (protobuf roll). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README. chromium
2 index 04d1a9b..015dd0f 100644
3 --- a/third_party/protobuf/README.chromium
4 +++ b/third_party/protobuf/README.chromium
5 @@ -29,6 +29,7 @@ Steps used to create the current version:
6 generate_descriptor_proto.sh script in the protobuf root directory for a
7 guide. Based on http://crrev.com/62331 and http://crrev.com/173228 .
8 03: Convert protobuf_lite to a component. Based on http://crrev.com/179806 .
9 + 04: Uninline various functions. Based on http://crrev.com/307332 .
10 (3) Generate descriptor_pb2.py using something like the following steps. Make
11 sure you've regenerated your buildfiles and will build protoc from the
12 newly-modified sources above.
13 diff --git a/third_party/protobuf/src/google/protobuf/generated_message_util.cc b/third_party/protobuf/src/google/protobuf/generated_message_util.cc
14 index e8fb398..8b3d037 100644
15 --- a/third_party/protobuf/src/google/protobuf/generated_message_util.cc
16 +++ b/third_party/protobuf/src/google/protobuf/generated_message_util.cc
17 @@ -60,6 +60,11 @@ void InitEmptyString() {
18 OnShutdown(&DeleteEmptyString);
19 }
20
21 +const ::std::string& GetEmptyString() {
22 + ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString );
23 + return GetEmptyStringAlreadyInited();
24 +}
25 +
26 int StringSpaceUsedExcludingSelf(const string& str) {
27 const void* start = &str;
28 const void* end = &str + 1;
29 diff --git a/third_party/protobuf/src/google/protobuf/generated_message_util.h b /third_party/protobuf/src/google/protobuf/generated_message_util.h
30 index 6357e27..ae8196b 100644
31 --- a/third_party/protobuf/src/google/protobuf/generated_message_util.h
32 +++ b/third_party/protobuf/src/google/protobuf/generated_message_util.h
33 @@ -84,10 +84,7 @@ LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyString AlreadyInited() {
34 assert(empty_string_ != NULL);
35 return *empty_string_;
36 }
37 -LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyString() {
38 - ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString );
39 - return GetEmptyStringAlreadyInited();
40 -}
41 +LIBPROTOBUF_EXPORT const ::std::string& GetEmptyString();
42
43 // Defined in generated_message_reflection.cc -- not actually part of the lite
44 // library.
45 diff --git a/third_party/protobuf/src/google/protobuf/stubs/once.cc b/third_part y/protobuf/src/google/protobuf/stubs/once.cc
46 index 889c647..1d93ddf 100644
47 --- a/third_party/protobuf/src/google/protobuf/stubs/once.cc
48 +++ b/third_party/protobuf/src/google/protobuf/stubs/once.cc
49 @@ -93,6 +93,13 @@ void GoogleOnceInitImpl(ProtobufOnceType* once, Closure* clos ure) {
50 }
51 }
52
53 +void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()) {
54 + if (internal::Acquire_Load(once) != ONCE_STATE_DONE) {
55 + internal::FunctionClosure0 func(init_func, false);
56 + GoogleOnceInitImpl(once, &func);
57 + }
58 +}
59 +
60 } // namespace protobuf
61 } // namespace google
62
63 diff --git a/third_party/protobuf/src/google/protobuf/stubs/once.h b/third_party /protobuf/src/google/protobuf/stubs/once.h
64 index 1f082c3..9522b22 100644
65 --- a/third_party/protobuf/src/google/protobuf/stubs/once.h
66 +++ b/third_party/protobuf/src/google/protobuf/stubs/once.h
67 @@ -122,12 +122,8 @@ typedef internal::AtomicWord ProtobufOnceType;
68 LIBPROTOBUF_EXPORT
69 void GoogleOnceInitImpl(ProtobufOnceType* once, Closure* closure);
70
71 -inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()) {
72 - if (internal::Acquire_Load(once) != ONCE_STATE_DONE) {
73 - internal::FunctionClosure0 func(init_func, false);
74 - GoogleOnceInitImpl(once, &func);
75 - }
76 -}
77 +LIBPROTOBUF_EXPORT
78 +void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)());
79
80 template <typename Arg>
81 inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)(Arg*),
OLDNEW
« no previous file with comments | « third_party/protobuf/patches/03_componentize_protobuf_lite.patch ('k') | third_party/protobuf/post_process_dist.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698