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

Side by Side Diff: chrome/browser/gpu_blacklist.cc

Issue 9960077: Modify the base::JSONReader interface to take a set of options rather than a boolean flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 8 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) 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/gpu_blacklist.h" 5 #include "chrome/browser/gpu_blacklist.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 } 762 }
763 763
764 bool GpuBlacklist::LoadGpuBlacklist( 764 bool GpuBlacklist::LoadGpuBlacklist(
765 const std::string& browser_version_string, 765 const std::string& browser_version_string,
766 const std::string& json_context, 766 const std::string& json_context,
767 GpuBlacklist::OsFilter os_filter) { 767 GpuBlacklist::OsFilter os_filter) {
768 browser_version_.reset(Version::GetVersionFromString(browser_version_string)); 768 browser_version_.reset(Version::GetVersionFromString(browser_version_string));
769 DCHECK(browser_version_.get() != NULL); 769 DCHECK(browser_version_.get() != NULL);
770 770
771 scoped_ptr<Value> root; 771 scoped_ptr<Value> root;
772 root.reset(base::JSONReader::Read(json_context, false)); 772 root.reset(base::JSONReader::Read(json_context));
773 if (root.get() == NULL || !root->IsType(Value::TYPE_DICTIONARY)) 773 if (root.get() == NULL || !root->IsType(Value::TYPE_DICTIONARY))
774 return false; 774 return false;
775 775
776 DictionaryValue* root_dictionary = static_cast<DictionaryValue*>(root.get()); 776 DictionaryValue* root_dictionary = static_cast<DictionaryValue*>(root.get());
777 DCHECK(root_dictionary); 777 DCHECK(root_dictionary);
778 return LoadGpuBlacklist(*root_dictionary, os_filter); 778 return LoadGpuBlacklist(*root_dictionary, os_filter);
779 } 779 }
780 780
781 bool GpuBlacklist::LoadGpuBlacklist( 781 bool GpuBlacklist::LoadGpuBlacklist(
782 const DictionaryValue& parsed_json, GpuBlacklist::OsFilter os_filter) { 782 const DictionaryValue& parsed_json, GpuBlacklist::OsFilter os_filter) {
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 return kGT; 997 return kGT;
998 if (op == ">=") 998 if (op == ">=")
999 return kGE; 999 return kGE;
1000 if (op == "any") 1000 if (op == "any")
1001 return kAny; 1001 return kAny;
1002 if (op == "between") 1002 if (op == "between")
1003 return kBetween; 1003 return kBetween;
1004 return kUnknown; 1004 return kUnknown;
1005 } 1005 }
1006 1006
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698