OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/streams_private/streams_private_api.h" | 5 #include "chrome/browser/extensions/api/streams_private/streams_private_api.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 return; | 32 return; |
33 | 33 |
34 size_t iter = 0; | 34 size_t iter = 0; |
35 std::string header_name; | 35 std::string header_name; |
36 std::string header_value; | 36 std::string header_value; |
37 while (headers->EnumerateHeaderLines(&iter, &header_name, &header_value)) { | 37 while (headers->EnumerateHeaderLines(&iter, &header_name, &header_value)) { |
38 base::Value* existing_value = NULL; | 38 base::Value* existing_value = NULL; |
39 if (result->Get(header_name, &existing_value)) { | 39 if (result->Get(header_name, &existing_value)) { |
40 base::StringValue* existing_string_value = | 40 base::StringValue* existing_string_value = |
41 static_cast<base::StringValue*>(existing_value); | 41 static_cast<base::StringValue*>(existing_value); |
42 existing_string_value->GetString()->append(", ").append(header_value); | 42 *existing_string_value = base::StringValue( |
43 existing_string_value->GetString() + ", " + std::move(header_value)); | |
brettw
2017/01/31 22:22:24
This use of std::move seems not to be helpful to m
jdoerrie
2017/02/01 12:36:26
C++11 introduced overloads for operator+ that take
| |
43 } else { | 44 } else { |
44 result->SetString(header_name, header_value); | 45 result->SetString(header_name, header_value); |
45 } | 46 } |
46 } | 47 } |
47 } | 48 } |
48 | 49 |
49 } // namespace | 50 } // namespace |
50 | 51 |
51 namespace streams_private = api::streams_private; | 52 namespace streams_private = api::streams_private; |
52 | 53 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > | 186 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > |
186 g_factory = LAZY_INSTANCE_INITIALIZER; | 187 g_factory = LAZY_INSTANCE_INITIALIZER; |
187 | 188 |
188 // static | 189 // static |
189 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* | 190 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* |
190 StreamsPrivateAPI::GetFactoryInstance() { | 191 StreamsPrivateAPI::GetFactoryInstance() { |
191 return g_factory.Pointer(); | 192 return g_factory.Pointer(); |
192 } | 193 } |
193 | 194 |
194 } // namespace extensions | 195 } // namespace extensions |
OLD | NEW |