| 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->GetString().append(", ").append(header_value); |
| 43 } else { | 43 } else { |
| 44 result->SetString(header_name, header_value); | 44 result->SetString(header_name, header_value); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 namespace streams_private = api::streams_private; | 51 namespace streams_private = api::streams_private; |
| 52 | 52 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > | 185 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > |
| 186 g_factory = LAZY_INSTANCE_INITIALIZER; | 186 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 187 | 187 |
| 188 // static | 188 // static |
| 189 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* | 189 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* |
| 190 StreamsPrivateAPI::GetFactoryInstance() { | 190 StreamsPrivateAPI::GetFactoryInstance() { |
| 191 return g_factory.Pointer(); | 191 return g_factory.Pointer(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace extensions | 194 } // namespace extensions |
| OLD | NEW |