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

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: Remove translated strings 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
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..36c4380f7c8894ed232b04e05de51e59e69ddcc4
--- /dev/null
+++ b/chromeos/network/onc/onc_utils.h
@@ -0,0 +1,50 @@
+// 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"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace chromeos {
+namespace onc {
+
+CHROMEOS_EXPORT extern const char kResultSuccess[];
+CHROMEOS_EXPORT extern const char kErrorNotAJsonDictionary[];
+CHROMEOS_EXPORT extern const char kErrorEncryptedOncMalformed[];
+CHROMEOS_EXPORT extern const char kErrorEncryptedOncUnsupportedEncryption[];
+CHROMEOS_EXPORT extern const char kErrorEncryptedOncUnableToDecrypt[];
+CHROMEOS_EXPORT extern const char kErrorEncryptedOncTooManyIterations[];
+CHROMEOS_EXPORT extern const char kErrorEncryptedOncUnableToDecode[];
+CHROMEOS_EXPORT extern const char kErrorPropertyDictionaryMalformed[];
+
+// Parses |json| according to the JSON format. If |json| is a JSON formatted
+// dictionary, the function returns the dictionary as a DictionaryValue and
+// doesn't modify |error|. Otherwise returns NULL and sets |error| to a
pneubeck (no reviews) 2012/12/04 10:43:56 |error| -> |result|
Greg Spencer (Chromium) 2012/12/07 18:12:27 Removed error.
+// non-user-facing (untranslated) error message.
+CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson(
+ const std::string& json,
+ std::string* result);
+
+// Decrypt the given EncryptedConfiguration |onc| (see the ONC specification)
+// using |passphrase|. The resulting UnencryptedConfiguration is returned and
+// |error| is not modified. If an error occurs, returns NULL and if additionally
pneubeck (no reviews) 2012/12/04 10:43:56 |error| is always modified if not-null.
Greg Spencer (Chromium) 2012/12/07 18:12:27 removed error
+// |error| is not NULL, |error| is set to a non-user-facing (untranslated) error
pneubeck (no reviews) 2012/12/04 10:43:56 |error| -> |result|
Greg Spencer (Chromium) 2012/12/07 18:12:27 removed error
+// message.
+CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> Decrypt(
+ const std::string& passphrase,
+ const base::DictionaryValue& onc,
+ std::string* result);
+
+} // chromeos
+} // onc
+
+#endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698