Add support to Pickle for reading and writing floats

BUG=136034


Review URL: https://chromiumcodereview.appspot.com/11416150

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169957 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: b1f61b03866ff2cccb0d9d07645d6780b719b0b9
diff --git a/base/pickle.h b/base/pickle.h
index a92915f..cd587de 100644
--- a/base/pickle.h
+++ b/base/pickle.h
@@ -34,6 +34,7 @@
   bool ReadUInt32(uint32* result) WARN_UNUSED_RESULT;
   bool ReadInt64(int64* result) WARN_UNUSED_RESULT;
   bool ReadUInt64(uint64* result) WARN_UNUSED_RESULT;
+  bool ReadFloat(float* result) WARN_UNUSED_RESULT;
   bool ReadString(std::string* result) WARN_UNUSED_RESULT;
   bool ReadWString(std::wstring* result) WARN_UNUSED_RESULT;
   bool ReadString16(string16* result) WARN_UNUSED_RESULT;
@@ -158,6 +159,9 @@
   bool ReadUInt64(PickleIterator* iter, uint64* result) const {
     return iter->ReadUInt64(result);
   }
+  bool ReadFloat(PickleIterator* iter, float* result) const {
+    return iter->ReadFloat(result);
+  }
   bool ReadString(PickleIterator* iter, std::string* result) const {
     return iter->ReadString(result);
   }
@@ -218,6 +222,9 @@
   bool WriteUInt64(uint64 value) {
     return WriteBytes(&value, sizeof(value));
   }
+  bool WriteFloat(float value) {
+    return WriteBytes(&value, sizeof(value));
+  }
   bool WriteString(const std::string& value);
   bool WriteWString(const std::wstring& value);
   bool WriteString16(const string16& value);