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

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

Issue 2881173003: Download Service : Added leveldb proto layer (Closed)
Patch Set: Removed Model::Destroy 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/entry.pb.h"
10 #include "components/download/internal/proto/request.pb.h"
11 #include "components/download/internal/proto/scheduling.pb.h"
12
13 namespace download {
14
15 class ProtoConversions {
16 public:
17 static Entry EntryFromProto(const protodb::Entry& proto);
18
19 static protodb::Entry EntryToProto(const Entry& entry);
20
21 static std::unique_ptr<std::vector<Entry>> EntryVectorFromProto(
22 std::unique_ptr<std::vector<protodb::Entry>> proto);
23
24 static std::unique_ptr<std::vector<protodb::Entry>> EntryVectorToProto(
25 std::unique_ptr<std::vector<Entry>> entries);
26
27 protected:
28 static protodb::Entry_State RequestStateToProto(Entry::State state);
29 static Entry::State RequestStateFromProto(protodb::Entry_State state);
30
31 static protodb::DownloadClient DownloadClientToProto(DownloadClient client);
32 static DownloadClient DownloadClientFromProto(protodb::DownloadClient client);
33
34 static SchedulingParams::NetworkRequirements NetworkRequirementsFromProto(
35 protodb::SchedulingParams_NetworkRequirements network_requirements);
36 static protodb::SchedulingParams_NetworkRequirements
37 NetworkRequirementsToProto(
38 SchedulingParams::NetworkRequirements network_requirements);
39
40 static SchedulingParams::BatteryRequirements BatteryRequirementsFromProto(
41 protodb::SchedulingParams_BatteryRequirements battery_requirements);
42 static protodb::SchedulingParams_BatteryRequirements
43 BatteryRequirementsToProto(
44 SchedulingParams::BatteryRequirements battery_requirements);
45
46 static SchedulingParams::Priority SchedulingPriorityFromProto(
47 protodb::SchedulingParams_Priority priority);
48 static protodb::SchedulingParams_Priority SchedulingPriorityToProto(
49 SchedulingParams::Priority priority);
50
51 static SchedulingParams SchedulingParamsFromProto(
52 const protodb::SchedulingParams& proto);
53 static void SchedulingParamsToProto(const SchedulingParams& scheduling_params,
54 protodb::SchedulingParams* proto);
55
56 static RequestParams RequestParamsFromProto(
57 const protodb::RequestParams& proto);
58 static void RequestParamsToProto(const RequestParams& request_params,
59 protodb::RequestParams* proto);
60 };
61
62 } // namespace download
63
64 #endif // COMPONENTS_DOWNLOAD_INTERNAL_PROTO_CONVERSIONS_H_
OLDNEW
« no previous file with comments | « components/download/internal/proto/scheduling.proto ('k') | components/download/internal/proto_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698