| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_store.h" | 5 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event
_store.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const StringToConstant kDataReductionProxyBypassActionTypeTable[] = { | 47 const StringToConstant kDataReductionProxyBypassActionTypeTable[] = { |
| 48 #define BYPASS_ACTION_TYPE(label, value) \ | 48 #define BYPASS_ACTION_TYPE(label, value) \ |
| 49 { #label, data_reduction_proxy::BYPASS_ACTION_TYPE_##label } \ | 49 { #label, data_reduction_proxy::BYPASS_ACTION_TYPE_##label } \ |
| 50 , | 50 , |
| 51 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_bypas
s_action_list.h" | 51 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_bypas
s_action_list.h" |
| 52 #undef BYPASS_ACTION_TYPE | 52 #undef BYPASS_ACTION_TYPE |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 std::string JoinListValueStrings(base::ListValue* list_value) { | 55 std::string JoinListValueStrings(base::ListValue* list_value) { |
| 56 std::vector<std::string> values; | 56 std::vector<std::string> values; |
| 57 for (auto it = list_value->begin(); it != list_value->end(); ++it) { | 57 for (const auto& value : *list_value) { |
| 58 std::string value_string; | 58 std::string value_string; |
| 59 base::Value* value = *it; | |
| 60 if (!value->GetAsString(&value_string)) | 59 if (!value->GetAsString(&value_string)) |
| 61 return std::string(); | 60 return std::string(); |
| 62 | 61 |
| 63 values.push_back(value_string); | 62 values.push_back(value_string); |
| 64 } | 63 } |
| 65 | 64 |
| 66 return base::JoinString(values, ";"); | 65 return base::JoinString(values, ";"); |
| 67 } | 66 } |
| 68 | 67 |
| 69 } // namespace | 68 } // namespace |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 last_bypass->SetString("url", clean_url.spec()); | 269 last_bypass->SetString("url", clean_url.spec()); |
| 271 } | 270 } |
| 272 } | 271 } |
| 273 | 272 |
| 274 std::string json; | 273 std::string json; |
| 275 base::JSONWriter::Write(*last_bypass.get(), &json); | 274 base::JSONWriter::Write(*last_bypass.get(), &json); |
| 276 return json; | 275 return json; |
| 277 } | 276 } |
| 278 | 277 |
| 279 } // namespace data_reduction_proxy | 278 } // namespace data_reduction_proxy |
| OLD | NEW |