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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase 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 "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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 callback); 353 callback);
354 } 354 }
355 355
356 // static 356 // static
357 std::unique_ptr<base::DictionaryValue> WebHistoryService::ReadResponse( 357 std::unique_ptr<base::DictionaryValue> WebHistoryService::ReadResponse(
358 WebHistoryService::Request* request) { 358 WebHistoryService::Request* request) {
359 std::unique_ptr<base::DictionaryValue> result; 359 std::unique_ptr<base::DictionaryValue> result;
360 if (request->GetResponseCode() == net::HTTP_OK) { 360 if (request->GetResponseCode() == net::HTTP_OK) {
361 std::unique_ptr<base::Value> value = 361 std::unique_ptr<base::Value> value =
362 base::JSONReader::Read(request->GetResponseBody()); 362 base::JSONReader::Read(request->GetResponseBody());
363 if (value.get() && value.get()->IsType(base::Value::TYPE_DICTIONARY)) 363 if (value.get() && value.get()->IsType(base::Value::Type::DICTIONARY))
364 result.reset(static_cast<base::DictionaryValue*>(value.release())); 364 result.reset(static_cast<base::DictionaryValue*>(value.release()));
365 else 365 else
366 DLOG(WARNING) << "Non-JSON response received from history server."; 366 DLOG(WARNING) << "Non-JSON response received from history server.";
367 } 367 }
368 return result; 368 return result;
369 } 369 }
370 370
371 std::unique_ptr<WebHistoryService::Request> WebHistoryService::QueryHistory( 371 std::unique_ptr<WebHistoryService::Request> WebHistoryService::QueryHistory(
372 const base::string16& text_query, 372 const base::string16& text_query,
373 const QueryOptions& options, 373 const QueryOptions& options,
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if (success && request->GetResponseCode() == net::HTTP_OK) { 629 if (success && request->GetResponseCode() == net::HTTP_OK) {
630 sync_pb::HistoryStatusResponse history_status; 630 sync_pb::HistoryStatusResponse history_status;
631 if (history_status.ParseFromString(request->GetResponseBody())) 631 if (history_status.ParseFromString(request->GetResponseBody()))
632 has_other_forms_of_browsing_history = history_status.has_derived_data(); 632 has_other_forms_of_browsing_history = history_status.has_derived_data();
633 } 633 }
634 634
635 callback.Run(has_other_forms_of_browsing_history); 635 callback.Run(has_other_forms_of_browsing_history);
636 } 636 }
637 637
638 } // namespace history 638 } // namespace history
OLDNEW
« no previous file with comments | « components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc ('k') | components/json_schema/json_schema_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698