Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
capnproto
Commits
28ad8ae3
Commit
28ad8ae3
authored
Nov 22, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate some redundant code.
parent
33b7bc42
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
27 deletions
+18
-27
rpc.c++
c++/src/capnp/rpc.c++
+18
-27
No files found.
c++/src/capnp/rpc.c++
View file @
28ad8ae3
...
...
@@ -655,6 +655,19 @@ private:
// implements ClientHook -----------------------------------------
Request
<
ObjectPointer
,
ObjectPointer
>
newCall
(
uint64_t
interfaceId
,
uint16_t
methodId
,
uint
firstSegmentWordSize
)
const
override
{
auto
request
=
kj
::
heap
<
RpcRequest
>
(
*
connectionState
,
firstSegmentWordSize
,
kj
::
addRef
(
*
this
));
auto
callBuilder
=
request
->
getCall
();
callBuilder
.
setInterfaceId
(
interfaceId
);
callBuilder
.
setMethodId
(
methodId
);
auto
root
=
request
->
getRoot
();
return
Request
<
ObjectPointer
,
ObjectPointer
>
(
root
,
kj
::
mv
(
request
));
}
VoidPromiseAndPipeline
call
(
uint64_t
interfaceId
,
uint16_t
methodId
,
kj
::
Own
<
CallContextHook
>&&
context
)
const
override
{
// Implement call() by copying params and results messages.
...
...
@@ -769,20 +782,6 @@ private:
// implements ClientHook -----------------------------------------
Request
<
ObjectPointer
,
ObjectPointer
>
newCall
(
uint64_t
interfaceId
,
uint16_t
methodId
,
uint
firstSegmentWordSize
)
const
override
{
auto
request
=
kj
::
heap
<
RpcRequest
>
(
*
connectionState
,
firstSegmentWordSize
,
kj
::
addRef
(
*
this
));
auto
callBuilder
=
request
->
getCall
();
callBuilder
.
getTarget
().
setExportedCap
(
importId
);
callBuilder
.
setInterfaceId
(
interfaceId
);
callBuilder
.
setMethodId
(
methodId
);
auto
root
=
request
->
getRoot
();
return
Request
<
ObjectPointer
,
ObjectPointer
>
(
root
,
kj
::
mv
(
request
));
}
kj
::
Maybe
<
const
ClientHook
&>
getResolved
()
const
{
return
nullptr
;
}
...
...
@@ -830,19 +829,6 @@ private:
// implements ClientHook -----------------------------------------
Request
<
ObjectPointer
,
ObjectPointer
>
newCall
(
uint64_t
interfaceId
,
uint16_t
methodId
,
uint
firstSegmentWordSize
)
const
override
{
auto
request
=
kj
::
heap
<
RpcRequest
>
(
*
connectionState
,
firstSegmentWordSize
,
kj
::
addRef
(
*
this
));
auto
callBuilder
=
request
->
getCall
();
callBuilder
.
setInterfaceId
(
interfaceId
);
callBuilder
.
setMethodId
(
methodId
);
auto
root
=
request
->
getRoot
();
return
Request
<
ObjectPointer
,
ObjectPointer
>
(
root
,
kj
::
mv
(
request
));
}
kj
::
Maybe
<
const
ClientHook
&>
getResolved
()
const
{
return
nullptr
;
}
...
...
@@ -923,6 +909,11 @@ private:
return
inner
.
lockExclusive
()
->
cap
->
newCall
(
interfaceId
,
methodId
,
firstSegmentWordSize
);
}
VoidPromiseAndPipeline
call
(
uint64_t
interfaceId
,
uint16_t
methodId
,
kj
::
Own
<
CallContextHook
>&&
context
)
const
override
{
return
inner
.
lockExclusive
()
->
cap
->
call
(
interfaceId
,
methodId
,
kj
::
mv
(
context
));
}
kj
::
Maybe
<
const
ClientHook
&>
getResolved
()
const
{
auto
lock
=
inner
.
lockShared
();
if
(
lock
->
isResolved
)
{
...
...
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