From 8607f6dae7f80f494d55cb6701234ca7be18738b Mon Sep 17 00:00:00 2001 From: "mstrydom@google.com" Date: Wed, 2 Sep 2009 22:21:31 +0000 Subject: This CL adds the createRawDataFromDataURL function to o3d.Pack. The function takes as input a data URL, decodes the data, and returns the raw data in a RawData object. If the data URL has an invalid format, an error message is displayed. Currently only data URL's encoded in base64 are supported. The mime type is ignored. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25252 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/import/cross/raw_data.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'o3d/import/cross/raw_data.h') diff --git a/o3d/import/cross/raw_data.h b/o3d/import/cross/raw_data.h index 092c800..96ea3f4 100644 --- a/o3d/import/cross/raw_data.h +++ b/o3d/import/cross/raw_data.h @@ -62,6 +62,11 @@ class RawData : public ParamObject { const String &uri, const String& filename); + // Creates a RawData object, taking as input a string containing a + // data URL. + static RawData::Ref CreateFromDataURL(ServiceLocator* service_locator, + const String& data_url); + virtual ~RawData(); const uint8 *GetData() const; @@ -110,6 +115,10 @@ class RawData : public ParamObject { bool SetFromFile(const String& filename); + // Decodes data from a data URL and stores that data in this + // RawData object. Returns false on error, true otherwise + bool SetFromDataURL(const String& data_url); + friend class IClassManager; friend class Pack; -- cgit v1.1