OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/api/data_reduction_proxy/data_reduction_prox
y_api.h" | 5 #include "chrome/browser/extensions/api/data_reduction_proxy/data_reduction_prox
y_api.h" |
6 | 6 |
| 7 #include <utility> |
7 #include <vector> | 8 #include <vector> |
8 | 9 |
9 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 11 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
11 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" | 12 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" |
12 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv
ice.h" | 13 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv
ice.h" |
13 #include "components/data_reduction_proxy/proto/data_store.pb.h" | 14 #include "components/data_reduction_proxy/proto/data_store.pb.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
(...skipping 28 matching lines...) Expand all Loading... |
45 scoped_ptr<base::ListValue> data_usage_buckets(new base::ListValue()); | 46 scoped_ptr<base::ListValue> data_usage_buckets(new base::ListValue()); |
46 for (const auto& data_usage_bucket : *data_usage) { | 47 for (const auto& data_usage_bucket : *data_usage) { |
47 scoped_ptr<base::ListValue> connection_usage_list(new base::ListValue()); | 48 scoped_ptr<base::ListValue> connection_usage_list(new base::ListValue()); |
48 for (auto connection_usage : data_usage_bucket.connection_usage()) { | 49 for (auto connection_usage : data_usage_bucket.connection_usage()) { |
49 scoped_ptr<base::ListValue> site_usage_list(new base::ListValue()); | 50 scoped_ptr<base::ListValue> site_usage_list(new base::ListValue()); |
50 for (auto site_usage : connection_usage.site_usage()) { | 51 for (auto site_usage : connection_usage.site_usage()) { |
51 scoped_ptr<base::DictionaryValue> usage(new base::DictionaryValue()); | 52 scoped_ptr<base::DictionaryValue> usage(new base::DictionaryValue()); |
52 usage->SetString("hostname", site_usage.hostname()); | 53 usage->SetString("hostname", site_usage.hostname()); |
53 usage->SetDouble("data_used", site_usage.data_used()); | 54 usage->SetDouble("data_used", site_usage.data_used()); |
54 usage->SetDouble("original_size", site_usage.original_size()); | 55 usage->SetDouble("original_size", site_usage.original_size()); |
55 site_usage_list->Append(usage.Pass()); | 56 site_usage_list->Append(std::move(usage)); |
56 } | 57 } |
57 connection_usage_list->Append(site_usage_list.Pass()); | 58 connection_usage_list->Append(std::move(site_usage_list)); |
58 } | 59 } |
59 data_usage_buckets->Append(connection_usage_list.Pass()); | 60 data_usage_buckets->Append(std::move(connection_usage_list)); |
60 } | 61 } |
61 | 62 |
62 base::DictionaryValue* result = new base::DictionaryValue(); | 63 base::DictionaryValue* result = new base::DictionaryValue(); |
63 result->Set("data_usage_buckets", data_usage_buckets.Pass()); | 64 result->Set("data_usage_buckets", std::move(data_usage_buckets)); |
64 Respond(OneArgument(result)); | 65 Respond(OneArgument(result)); |
65 } | 66 } |
66 | 67 |
67 } // namespace extensions | 68 } // namespace extensions |
OLD | NEW |