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

Side by Side Diff: content/browser/gpu/gpu_blacklist.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/gpu/gpu_blacklist.h" 5 #include "content/browser/gpu/gpu_blacklist.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 } 592 }
593 593
594 GpuBlacklist::~GpuBlacklist() { 594 GpuBlacklist::~GpuBlacklist() {
595 Clear(); 595 Clear();
596 } 596 }
597 597
598 bool GpuBlacklist::LoadGpuBlacklist(const std::string& json_context, 598 bool GpuBlacklist::LoadGpuBlacklist(const std::string& json_context,
599 bool current_os_only) { 599 bool current_os_only) {
600 scoped_ptr<Value> root; 600 scoped_ptr<Value> root;
601 root.reset(base::JSONReader::Read(json_context, false)); 601 root.reset(base::JSONReader::Read(json_context, false));
602 if (root.get() == NULL || !root->IsType(Value::TYPE_DICTIONARY)) 602 if (root.get() == NULL || !root->IsDictionary())
603 return false; 603 return false;
604 604
605 DictionaryValue* root_dictionary = static_cast<DictionaryValue*>(root.get()); 605 DictionaryValue* root_dictionary = static_cast<DictionaryValue*>(root.get());
606 DCHECK(root_dictionary); 606 DCHECK(root_dictionary);
607 return LoadGpuBlacklist(*root_dictionary, current_os_only); 607 return LoadGpuBlacklist(*root_dictionary, current_os_only);
608 } 608 }
609 609
610 bool GpuBlacklist::LoadGpuBlacklist(const DictionaryValue& parsed_json, 610 bool GpuBlacklist::LoadGpuBlacklist(const DictionaryValue& parsed_json,
611 bool current_os_only) { 611 bool current_os_only) {
612 std::vector<GpuBlacklistEntry*> entries; 612 std::vector<GpuBlacklistEntry*> entries;
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 browser_version_info.reset( 963 browser_version_info.reset(
964 new VersionInfo(version_op, version_string, version_string2)); 964 new VersionInfo(version_op, version_string, version_string2));
965 if (!browser_version_info->IsValid()) 965 if (!browser_version_info->IsValid())
966 return kMalformed; 966 return kMalformed;
967 if (browser_version_info->Contains(*browser_version_)) 967 if (browser_version_info->Contains(*browser_version_))
968 return kSupported; 968 return kSupported;
969 return kUnsupported; 969 return kUnsupported;
970 } 970 }
971 return kSupported; 971 return kSupported;
972 } 972 }
OLDNEW
« no previous file with comments | « content/browser/geolocation/network_location_request.cc ('k') | content/browser/speech/speech_recognition_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698