Browse Source

Use generic base::Value::SetKey

Remove base::Value::SetDoubleWithoutPathExpansion
https://chromium-review.googlesource.com/591654

Remove base::Value::SetStringWithoutPathExpansion
https://chromium-review.googlesource.com/592368

Remove base::Value::SetIntegerWithoutPathExpansion
https://chromium-review.googlesource.com/591655
deepak1556 7 years ago
parent
commit
75c17cf846

+ 6 - 8
atom/browser/mac/dict_util.mm

@@ -87,18 +87,17 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
 
     id value = [dict objectForKey:key];
     if ([value isKindOfClass:[NSString class]]) {
-      result->SetStringWithoutPathExpansion(
-          str_key, base::SysNSStringToUTF8(value));
+      result->SetKey(str_key, base::Value(base::SysNSStringToUTF8(value)));
     } else if ([value isKindOfClass:[NSNumber class]]) {
       const char* objc_type = [value objCType];
       if (strcmp(objc_type, @encode(BOOL)) == 0 ||
           strcmp(objc_type, @encode(char)) == 0)
-        result->SetBooleanWithoutPathExpansion(str_key, [value boolValue]);
+        result->SetKey(str_key, base::Value([value boolValue]));
       else if (strcmp(objc_type, @encode(double)) == 0 ||
                strcmp(objc_type, @encode(float)) == 0)
-        result->SetDoubleWithoutPathExpansion(str_key, [value doubleValue]);
+        result->SetKey(str_key, base::Value([value doubleValue]));
       else
-        result->SetIntegerWithoutPathExpansion(str_key, [value intValue]);
+        result->SetKey(str_key, base::Value([value intValue]));
     } else if ([value isKindOfClass:[NSArray class]]) {
       std::unique_ptr<base::ListValue> sub_arr = NSArrayToListValue(value);
       if (sub_arr)
@@ -115,9 +114,8 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
         result->SetWithoutPathExpansion(str_key,
                                         base::MakeUnique<base::Value>());
     } else {
-      result->SetStringWithoutPathExpansion(
-          str_key,
-          base::SysNSStringToUTF8([value description]));
+      result->SetKey(str_key,
+                     base::Value(base::SysNSStringToUTF8([value description])));
     }
   }
 

+ 1 - 1
atom/browser/net/atom_network_delegate.cc

@@ -108,7 +108,7 @@ void ToDictionary(base::DictionaryValue* details,
   std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
   net::HttpRequestHeaders::Iterator it(headers);
   while (it.GetNext())
-    dict->SetStringWithoutPathExpansion(it.name(), it.value());
+    dict->SetKey(it.name(), base::Value(it.value()));
   details->Set("requestHeaders", std::move(dict));
 }
 

+ 1 - 1
brightray/browser/inspectable_web_contents_impl.cc

@@ -608,7 +608,7 @@ void InspectableWebContentsImpl::GetPreferences(
 void InspectableWebContentsImpl::SetPreference(const std::string& name,
                                                const std::string& value) {
   DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
-  update.Get()->SetStringWithoutPathExpansion(name, value);
+  update.Get()->SetKey(name, base::Value(value));
 }
 
 void InspectableWebContentsImpl::RemovePreference(const std::string& name) {

+ 1 - 1
brightray/browser/zoom_level_delegate.cc

@@ -95,7 +95,7 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
   if (modification_is_removal)
     host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, nullptr);
   else
-    host_zoom_dictionary->SetDoubleWithoutPathExpansion(change.host, level);
+    host_zoom_dictionary->SetKey(change.host, base::Value(level));
 }
 
 void ZoomLevelDelegate::ExtractPerHostZoomLevels(