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

Unified Diff: content/browser/mojo/merge_dictionary.cc

Issue 2335423002: Revert of Enforce capability spec renderer <--> browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/mojo/merge_dictionary.h ('k') | content/browser/mojo/merge_dictionary_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/mojo/merge_dictionary.cc
diff --git a/content/browser/mojo/merge_dictionary.cc b/content/browser/mojo/merge_dictionary.cc
deleted file mode 100644
index 4e6840f8674eff2292c3abac4c19ed96826269e9..0000000000000000000000000000000000000000
--- a/content/browser/mojo/merge_dictionary.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/mojo/merge_dictionary.h"
-
-namespace content {
-
-void MergeDictionary(base::DictionaryValue* target,
- const base::DictionaryValue* source) {
- for (base::DictionaryValue::Iterator it(*source); !it.IsAtEnd();
- it.Advance()) {
- const base::Value* merge_value = &it.value();
- // Check whether we have to merge dictionaries.
- if (merge_value->IsType(base::Value::TYPE_DICTIONARY)) {
- base::DictionaryValue* sub_dict;
- if (target->GetDictionaryWithoutPathExpansion(it.key(), &sub_dict)) {
- MergeDictionary(
- sub_dict,
- static_cast<const base::DictionaryValue*>(merge_value));
- continue;
- }
- }
- if (merge_value->IsType(base::Value::TYPE_LIST)) {
- const base::ListValue* merge_list = nullptr;
- if (merge_value->GetAsList(&merge_list)) {
- base::ListValue* target_list = nullptr;
- CHECK(target->GetListWithoutPathExpansion(it.key(), &target_list));
- for (size_t i = 0; i < merge_list->GetSize(); ++i) {
- std::string value;
- CHECK(merge_list->GetString(i, &value));
- target_list->AppendString(value);
- }
- }
- } else {
- // All other cases: Make a copy and hook it up.
- target->SetWithoutPathExpansion(it.key(), merge_value->DeepCopy());
- }
- }
-}
-
-} // namespace content
« no previous file with comments | « content/browser/mojo/merge_dictionary.h ('k') | content/browser/mojo/merge_dictionary_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698