Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: chrome/browser/extensions/api/streams_private/streams_private_api.cc

Issue 2516363005: Inline StringValue into base::Value (Closed)
Patch Set: GetString by ref and TestStringValue Fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698