Index: components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc |
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc |
index b691faf0b538ca80680385d7c864e1e4b942d37e..b9494eda08e56ca1a30cf716f7a3e4cc0fa170b6 100644 |
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc |
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc |
@@ -84,20 +84,54 @@ ProxyServer_ProxyScheme ProxySchemeFromScheme(net::ProxyServer::Scheme scheme) { |
return ProxyServer_ProxyScheme_HTTP; |
case net::ProxyServer::SCHEME_HTTPS: |
return ProxyServer_ProxyScheme_HTTPS; |
case net::ProxyServer::SCHEME_QUIC: |
return ProxyServer_ProxyScheme_QUIC; |
default: |
return ProxyServer_ProxyScheme_UNSPECIFIED; |
} |
} |
+VersionInfo_Channel ProtoChannelFromChannel(version_info::Channel channel) { |
+ switch (channel) { |
+ case version_info::Channel::UNKNOWN: |
+ return VersionInfo_Channel_UNKNOWN; |
+ case version_info::Channel::CANARY: |
+ return VersionInfo_Channel_CANARY; |
+ case version_info::Channel::DEV: |
+ return VersionInfo_Channel_DEV; |
+ case version_info::Channel::BETA: |
+ return VersionInfo_Channel_BETA; |
+ case version_info::Channel::STABLE: |
+ return VersionInfo_Channel_STABLE; |
+ default: |
+ return VersionInfo_Channel_UNKNOWN; |
tbansal1
2016/06/28 21:32:15
Add NOTREACHED() in default.
RyanSturm
2016/06/28 22:22:14
Acknowledged.
|
+ } |
+} |
+ |
+version_info::Channel ChannelFromProtoChannel(VersionInfo_Channel channel) { |
+ switch (channel) { |
+ case VersionInfo_Channel_UNKNOWN: |
+ return version_info::Channel::UNKNOWN; |
+ case VersionInfo_Channel_CANARY: |
+ return version_info::Channel::CANARY; |
+ case VersionInfo_Channel_DEV: |
+ return version_info::Channel::DEV; |
+ case VersionInfo_Channel_BETA: |
+ return version_info::Channel::BETA; |
+ case VersionInfo_Channel_STABLE: |
+ return version_info::Channel::STABLE; |
+ default: |
+ return version_info::Channel::UNKNOWN; |
tbansal1
2016/06/28 21:32:15
Add NOTREACHED() in default.
RyanSturm
2016/06/28 22:22:14
Acknowledged.
|
+ } |
+} |
+ |
void TimeDeltaToDuration(const base::TimeDelta& time_delta, |
Duration* duration) { |
duration->set_seconds(time_delta.InSeconds()); |
base::TimeDelta partial_seconds = |
time_delta - base::TimeDelta::FromSeconds(time_delta.InSeconds()); |
duration->set_nanos(partial_seconds.InMicroseconds() * |
base::Time::kNanosecondsPerMicrosecond); |
} |
base::TimeDelta DurationToTimeDelta(const Duration& duration) { |