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
d09ab853
Commit
d09ab853
authored
Apr 19, 2010
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow services with lite runtime when using rpc generator plugin.
parent
b3f6a158
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
descriptor.cc
src/google/protobuf/descriptor.cc
+6
-2
descriptor_unittest.cc
src/google/protobuf/descriptor_unittest.cc
+11
-1
No files found.
src/google/protobuf/descriptor.cc
View file @
d09ab853
...
...
@@ -3720,10 +3720,14 @@ void DescriptorBuilder::ValidateEnumValueOptions(
}
void
DescriptorBuilder
::
ValidateServiceOptions
(
ServiceDescriptor
*
service
,
const
ServiceDescriptorProto
&
proto
)
{
if
(
IsLite
(
service
->
file
()))
{
if
(
IsLite
(
service
->
file
())
&&
(
service
->
file
()
->
options
().
cc_generic_services
()
||
service
->
file
()
->
options
().
java_generic_services
()))
{
AddError
(
service
->
full_name
(),
proto
,
DescriptorPool
::
ErrorCollector
::
NAME
,
"Files with optimize_for = LITE_RUNTIME cannot define services."
);
"Files with optimize_for = LITE_RUNTIME cannot define services "
"unless you set both options cc_generic_services and "
"java_generic_sevices to false."
);
}
VALIDATE_OPTIONS_FROM_ARRAY
(
service
,
method
,
Method
);
...
...
src/google/protobuf/descriptor_unittest.cc
View file @
d09ab853
...
...
@@ -3487,7 +3487,17 @@ TEST_F(ValidationErrorTest, NoLiteServices) {
"service { name:
\"
Foo
\"
}"
,
"foo.proto: Foo: NAME: Files with optimize_for = LITE_RUNTIME cannot "
"define services.
\n
"
);
"define services unless you set both options cc_generic_services and "
"java_generic_sevices to false.
\n
"
);
BuildFile
(
"name:
\"
bar.proto
\"
"
"options {"
" optimize_for: LITE_RUNTIME"
" cc_generic_services: false"
" java_generic_services: false"
"} "
"service { name:
\"
Foo
\"
}"
);
}
TEST_F
(
ValidationErrorTest
,
RollbackAfterError
)
{
...
...
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