Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: components/download/internal/proto_conversions.h

Issue 2881173003: Download Service : Added leveldb proto layer (Closed)
Patch Set: More unittests Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_DOWNLOAD_INTERNAL_PROTO_CONVERSIONS_H_
6 #define COMPONENTS_DOWNLOAD_INTERNAL_PROTO_CONVERSIONS_H_
7
8 #include "components/download/internal/entry.h"
9 #include "components/download/internal/proto/request.pb.h"
10
11 namespace download {
12
13 class ProtoConversions {
14 public:
15 static Entry EntryFromProto(const protodb::Entry& proto);
16
17 static protodb::Entry EntryToProto(const Entry& entry);
18
19 static std::unique_ptr<std::vector<Entry>> EntryVectorFromProto(
20 std::unique_ptr<std::vector<protodb::Entry>> proto);
21
22 static std::unique_ptr<std::vector<protodb::Entry>> EntryVectorToProto(
23 std::unique_ptr<std::vector<Entry>> entries);
24
25 protected:
26 static protodb::Entry_State RequestStateToProto(Entry::State state);
27 static Entry::State RequestStateFromProto(protodb::Entry_State state);
28
29 static protodb::DownloadClient DownloadClientToProto(DownloadClient client);
30 static DownloadClient DownloadClientFromProto(protodb::DownloadClient client);
31
32 static SchedulingParams::NetworkRequirements NetworkRequirementsFromProto(
33 protodb::SchedulingParams_NetworkRequirements network_requirements);
34 static protodb::SchedulingParams_NetworkRequirements
35 NetworkRequirementsToProto(
36 SchedulingParams::NetworkRequirements network_requirements);
37
38 static SchedulingParams::BatteryRequirements BatteryRequirementsFromProto(
39 protodb::SchedulingParams_BatteryRequirements battery_requirements);
40 static protodb::SchedulingParams_BatteryRequirements
41 BatteryRequirementsToProto(
42 SchedulingParams::BatteryRequirements battery_requirements);
43
44 static SchedulingParams::Priority SchedulingPriorityFromProto(
45 protodb::SchedulingParams_Priority priority);
46 static protodb::SchedulingParams_Priority SchedulingPriorityToProto(
47 SchedulingParams::Priority priority);
48
49 static SchedulingParams SchedulingParamsFromProto(
50 const protodb::SchedulingParams& proto);
51 static void SchedulingParamsToProto(const SchedulingParams& scheduling_params,
52 protodb::SchedulingParams* proto);
53
54 static RequestParams RequestParamsFromProto(
55 const protodb::RequestParams& proto);
56 static void RequestParamsToProto(const RequestParams& request_params,
57 protodb::RequestParams* proto);
58 };
59
60 } // namespace download
61
62 #endif // COMPONENTS_DOWNLOAD_INTERNAL_PROTO_CONVERSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698