blob: 117e424d00c9731de9c10811715fde6cb504a545 [file] [log] [blame] [view]
nharper6153bc72019-05-08 12:04:34 -07001# QUIC platform API
2
3This directory contains the infrastructure blocks needed to support QUIC in
4certain platform. These APIs act as interaction layers between QUIC core and
5either the upper layer application (i.e. Chrome, Envoy) or the platform's own
6infrastructure (i.e. logging, test framework and system IO). QUIC core needs the
7implementations of these APIs to build and function appropriately. There is
8unidirectional dependency from QUIC core to most of the APIs here, such as
9QUIC_LOG and QuicMutex, but a few APIs also depend back on QUIC core's basic
10QUIC data types, such as QuicClock and QuicSleep.
11
12- APIs used by QUIC core:
13
14 Most APIs are used by QUIC core to interact with platform infrastructure
15 (i.e. QUIC_LOG) or to wrap around platform dependent data types (i.e.
danzh18347702019-06-21 11:15:12 -070016 QuicThread), the dependency is:
nharper6153bc72019-05-08 12:04:34 -070017
danzh18347702019-06-21 11:15:12 -070018```
19application -> quic_core -> quic_platform_api
20 | |
21 v v
22platform_infrastructure <- quic_platform_impl
23```
nharper6153bc72019-05-08 12:04:34 -070024
25- APIs used by applications:
26
27 Some APIs are used by applications to interact with QUIC core (i.e.
28 QuicMemSlice). For such APIs, their dependency model is:
29
danzh18347702019-06-21 11:15:12 -070030```
31application -> quic_core -> quic_platform_api
32 | ^
33 | |
34 -------------------> quic_platform_impl
35 | |
36 | v
37 -------------------> platform_infrastructure
38```
nharper6153bc72019-05-08 12:04:34 -070039
danzh18347702019-06-21 11:15:12 -070040&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An example for such dependency
41is QuicClock.
nharper6153bc72019-05-08 12:04:34 -070042
danzh18347702019-06-21 11:15:12 -070043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Or
nharper6153bc72019-05-08 12:04:34 -070044
danzh18347702019-06-21 11:15:12 -070045```
46application -> quic_core -> quic_platform_api
47 | ^
48 | |
49 | v
50 -------------------> quic_platform_impl
51 | |
52 | v
53 -------------------> platform_infrastructure
54```
nharper6153bc72019-05-08 12:04:34 -070055
danzh18347702019-06-21 11:15:12 -070056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An example for such dependency
57is QuicMemSlice.
nharper6153bc72019-05-08 12:04:34 -070058
59# Documentation of each API and its usage.
60
61QuicMemSlice
62: QuicMemSlice is used to wrap application data and pass to QUIC stream's
63 write interface. It refers to a memory block of data which should be around
64 till QuicMemSlice::Reset() is called. It's upto each platform, to implement
65 it as reference counted or not.
66
67QuicClock
68: QuicClock is used by QUIC core to get current time. Its instance is created
69 by applications and passed into QuicDispatcher and
70 QuicConnectionHelperInterface.
71
72TODO(b/131224336) add document for other APIs