const base::DictionaryValue* root,
const base::DictionaryValue** out);
-// Gets sub-file "name" from "dir".
-bool GetChildNode(const base::DictionaryValue* root,
- const std::string& name,
+// Gets the "files" from "dir".
+bool GetFilesNode(const base::DictionaryValue* root,
const base::DictionaryValue* dir,
const base::DictionaryValue** out) {
// Test for symbol linked directory.
dir = linked_node;
}
- // Otherwise search for the "files" map.
+ return dir->GetDictionaryWithoutPathExpansion("files", out);
+}
+
+// Gets sub-file "name" from "dir".
+bool GetChildNode(const base::DictionaryValue* root,
+ const std::string& name,
+ const base::DictionaryValue* dir,
+ const base::DictionaryValue** out) {
const base::DictionaryValue* files = NULL;
- return dir->GetDictionaryWithoutPathExpansion("files", &files) &&
+ return GetFilesNode(root, dir, &files) &&
files->GetDictionaryWithoutPathExpansion(name, out);
}
return false;
const base::DictionaryValue* files;
- if (!node->GetDictionaryWithoutPathExpansion("files", &files))
+ if (!GetFilesNode(header_.get(), node, &files))
return false;
base::DictionaryValue::Iterator iter(*files);