Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
b9649765
Commit
b9649765
authored
Aug 31, 2016
by
Feng Xiao
Committed by
GitHub
Aug 31, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2024 from pstavirs/master
Restore New*Callback into google::protobuf namespace …
parents
c0a6a6b4
eedc7be6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
12 deletions
+8
-12
cpp_message.cc
src/google/protobuf/compiler/cpp/cpp_message.cc
+1
-1
cpp_unittest.cc
src/google/protobuf/compiler/cpp/cpp_unittest.cc
+1
-1
callback.h
src/google/protobuf/stubs/callback.h
+2
-2
common_unittest.cc
src/google/protobuf/stubs/common_unittest.cc
+0
-2
once_unittest.cc
src/google/protobuf/stubs/once_unittest.cc
+2
-3
protostream_objectwriter.cc
...google/protobuf/util/internal/protostream_objectwriter.cc
+1
-1
message_differencer.cc
src/google/protobuf/util/message_differencer.cc
+1
-2
No files found.
src/google/protobuf/compiler/cpp/cpp_message.cc
View file @
b9649765
...
...
@@ -2956,7 +2956,7 @@ GenerateMergeFromCodedStream(io::Printer* printer) {
// on the CodedOutputStream.
printer
->
Print
(
" ::google::protobuf::io::LazyStringOutputStream unknown_fields_string(
\n
"
" ::google::protobuf::
internal::
NewPermanentCallback(
\n
"
" ::google::protobuf::NewPermanentCallback(
\n
"
" &MutableUnknownFieldsFor$classname$, this));
\n
"
" ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
\n
"
" &unknown_fields_string, false);
\n
"
,
...
...
src/google/protobuf/compiler/cpp/cpp_unittest.cc
View file @
b9649765
...
...
@@ -1252,7 +1252,7 @@ class GeneratedServiceTest : public testing::Test {
foo_
(
descriptor_
->
FindMethodByName
(
"Foo"
)),
bar_
(
descriptor_
->
FindMethodByName
(
"Bar"
)),
stub_
(
&
mock_channel_
),
done_
(
::
google
::
protobuf
::
internal
::
NewPermanentCallback
(
&
DoNothing
))
{}
done_
(
NewPermanentCallback
(
&
DoNothing
))
{}
virtual
void
SetUp
()
{
ASSERT_TRUE
(
foo_
!=
NULL
);
...
...
src/google/protobuf/stubs/callback.h
View file @
b9649765
...
...
@@ -381,6 +381,8 @@ class MethodResultCallback_5_2 : public ResultCallback2<R, A1, A2> {
typename
remove_reference
<
P5
>::
type
p5_
;
};
}
// namespace internal
// See Closure.
inline
Closure
*
NewCallback
(
void
(
*
function
)())
{
return
new
internal
::
FunctionClosure0
(
function
,
true
);
...
...
@@ -533,8 +535,6 @@ inline ResultCallback2<R, A1, A2>* NewPermanentCallback(
p2
,
p3
,
p4
,
p5
);
}
}
// namespace internal
// A function which does nothing. Useful for creating no-op callbacks, e.g.:
// Closure* nothing = NewCallback(&DoNothing);
void
LIBPROTOBUF_EXPORT
DoNothing
();
...
...
src/google/protobuf/stubs/common_unittest.cc
View file @
b9649765
...
...
@@ -41,8 +41,6 @@
namespace
google
{
namespace
protobuf
{
using
internal
::
NewCallback
;
using
internal
::
NewPermanentCallback
;
namespace
{
// TODO(kenton): More tests.
...
...
src/google/protobuf/stubs/once_unittest.cc
View file @
b9649765
...
...
@@ -43,7 +43,6 @@
namespace
google
{
namespace
protobuf
{
using
internal
::
NewCallback
;
namespace
{
class
OnceInitTest
:
public
testing
::
Test
{
...
...
@@ -128,11 +127,11 @@ class OnceInitTest : public testing::Test {
};
TestThread
*
RunInitOnceInNewThread
()
{
return
new
TestThread
(
internal
::
NewCallback
(
this
,
&
OnceInitTest
::
InitOnce
));
return
new
TestThread
(
NewCallback
(
this
,
&
OnceInitTest
::
InitOnce
));
}
TestThread
*
RunInitRecursiveOnceInNewThread
()
{
return
new
TestThread
(
internal
::
NewCallback
(
this
,
&
OnceInitTest
::
InitRecursiveOnce
));
NewCallback
(
this
,
&
OnceInitTest
::
InitRecursiveOnce
));
}
enum
State
{
...
...
src/google/protobuf/util/internal/protostream_objectwriter.cc
View file @
b9649765
...
...
@@ -907,7 +907,7 @@ Status ProtoStreamObjectWriter::RenderFieldMask(ProtoStreamObjectWriter* ow,
// conversions as much as possible. Because ToSnakeCase sometimes returns the
// wrong value.
google
::
protobuf
::
scoped_ptr
<
ResultCallback1
<
util
::
Status
,
StringPiece
>
>
callback
(
::
google
::
protobuf
::
internal
::
NewPermanentCallback
(
&
RenderOneFieldPath
,
ow
));
NewPermanentCallback
(
&
RenderOneFieldPath
,
ow
));
return
DecodeCompactFieldMaskPaths
(
data
.
str
(),
callback
.
get
());
}
...
...
src/google/protobuf/util/message_differencer.cc
View file @
b9649765
...
...
@@ -1389,8 +1389,7 @@ bool MessageDifferencer::MatchRepeatedFieldIndices(
// doesn't necessarily imply Compare(b, c). Therefore a naive greedy
// algorithm will fail to find a maximum matching.
// Here we use the argumenting path algorithm.
MaximumMatcher
::
NodeMatchCallback
*
callback
=
::
google
::
protobuf
::
internal
::
NewPermanentCallback
(
MaximumMatcher
::
NodeMatchCallback
*
callback
=
NewPermanentCallback
(
this
,
&
MessageDifferencer
::
IsMatch
,
repeated_field
,
key_comparator
,
&
message1
,
&
message2
,
parent_fields
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment