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

Side by Side Diff: components/history/core/browser/web_history_service.cc

Issue 2287733002: Switch //components away from base::ListValue::Append(Value*) overload. (Closed)
Patch Set: Test fix Created 4 years, 3 months 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 "components/history/core/browser/web_history_service.h" 5 #include "components/history/core/browser/web_history_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 if (!version_info.empty()) 298 if (!version_info.empty())
299 url = net::AppendQueryParameter(url, "kvi", version_info); 299 url = net::AppendQueryParameter(url, "kvi", version_info);
300 300
301 return url; 301 return url;
302 } 302 }
303 303
304 // Creates a DictionaryValue to hold the parameters for a deletion. 304 // Creates a DictionaryValue to hold the parameters for a deletion.
305 // Ownership is passed to the caller. 305 // Ownership is passed to the caller.
306 // |url| may be empty, indicating a time-range deletion. 306 // |url| may be empty, indicating a time-range deletion.
307 base::DictionaryValue* CreateDeletion( 307 std::unique_ptr<base::DictionaryValue> CreateDeletion(
308 const std::string& min_time, 308 const std::string& min_time,
309 const std::string& max_time, 309 const std::string& max_time,
310 const GURL& url) { 310 const GURL& url) {
311 base::DictionaryValue* deletion = new base::DictionaryValue; 311 std::unique_ptr<base::DictionaryValue> deletion(new base::DictionaryValue);
312 deletion->SetString("type", "CHROME_HISTORY"); 312 deletion->SetString("type", "CHROME_HISTORY");
313 if (url.is_valid()) 313 if (url.is_valid())
314 deletion->SetString("url", url.spec()); 314 deletion->SetString("url", url.spec());
315 deletion->SetString("min_timestamp_usec", min_time); 315 deletion->SetString("min_timestamp_usec", min_time);
316 deletion->SetString("max_timestamp_usec", max_time); 316 deletion->SetString("max_timestamp_usec", max_time);
317 return deletion; 317 return deletion;
318 } 318 }
319 319
320 } // namespace 320 } // namespace
321 321
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 if (success && request->GetResponseCode() == net::HTTP_OK) { 625 if (success && request->GetResponseCode() == net::HTTP_OK) {
626 sync_pb::HistoryStatusResponse history_status; 626 sync_pb::HistoryStatusResponse history_status;
627 if (history_status.ParseFromString(request->GetResponseBody())) 627 if (history_status.ParseFromString(request->GetResponseBody()))
628 has_other_forms_of_browsing_history = history_status.has_derived_data(); 628 has_other_forms_of_browsing_history = history_status.has_derived_data();
629 } 629 }
630 630
631 callback.Run(has_other_forms_of_browsing_history); 631 callback.Run(has_other_forms_of_browsing_history);
632 } 632 }
633 633
634 } // namespace history 634 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698