Shaka Player Embedded
net.h
Go to the documentation of this file.
1 // Copyright 2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_JS_NET_H_
16 #define SHAKA_EMBEDDED_JS_NET_H_
17 
18 #include <string>
19 #include <unordered_map>
20 #include <vector>
21 
22 #include "shaka/net.h"
23 #include "shaka/optional.h"
25 #include "src/mapping/enum.h"
26 #include "src/mapping/struct.h"
27 
28 namespace shaka {
29 namespace js {
30 
31 struct Request : public Struct {
33 
34  ADD_DICT_FIELD(uris, std::vector<std::string>);
35  ADD_DICT_FIELD(method, std::string);
36  ADD_DICT_FIELD(headers, std::unordered_map<std::string, std::string>);
38 };
39 
40 struct Response : public Struct {
42 
43  ADD_DICT_FIELD(uri, std::string);
44  ADD_DICT_FIELD(originalUri, std::string);
45  ADD_DICT_FIELD(headers, std::unordered_map<std::string, std::string>);
47  ADD_DICT_FIELD(fromCache, optional<bool>);
49 };
50 
51 } // namespace js
52 } // namespace shaka
53 
55 
56 #endif // SHAKA_EMBEDDED_JS_NET_H_
ADD_DICT_FIELD(uris, std::vector< std::string >)
RequestType
Definition: net.h:38
CONVERT_ENUM_AS_NUMBER(shaka, RequestType)
DECLARE_STRUCT_SPECIAL_METHODS_MOVE_ONLY(Request)