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

Unified Diff: chromeos/network/onc/onc_utils.h

Issue 11299236: This moves the ONC parsing code into chromeos/network/onc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit tests Created 8 years 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 | « chromeos/network/onc/onc_translator_unittest.cc ('k') | chromeos/network/onc/onc_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_utils.h
diff --git a/chromeos/network/onc/onc_utils.h b/chromeos/network/onc/onc_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..96b8a1e9bc3fd0231e9737b25e049dc4cbae3dc9
--- /dev/null
+++ b/chromeos/network/onc/onc_utils.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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.
+
+#ifndef CHROMEOS_NETWORK_ONC_ONC_UTILS_H_
+#define CHROMEOS_NETWORK_ONC_ONC_UTILS_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/network/onc/onc_constants.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace chromeos {
+namespace onc {
+
+// Parses |json| according to the JSON format. If |json| is a JSON formatted
+// dictionary, the function returns the dictionary as a DictionaryValue.
+// Otherwise returns NULL.
+CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson(
+ const std::string& json);
+
+// Decrypt the given EncryptedConfiguration |onc| (see the ONC specification)
+// using |passphrase|. The resulting UnencryptedConfiguration is returned. If an
+// error occurs, returns NULL.
+CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> Decrypt(
+ const std::string& passphrase,
+ const base::DictionaryValue& onc);
+
+// For logging only: strings not user facing.
+CHROMEOS_EXPORT std::string GetSourceAsString(ONCSource source);
+
+} // chromeos
+} // onc
+
+#endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_
« no previous file with comments | « chromeos/network/onc/onc_translator_unittest.cc ('k') | chromeos/network/onc/onc_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698