~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to WebCore/bindings/js/SerializedScriptValue.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-02-04 19:30:57 UTC
  • mfrom: (1.2.8 upstream) (4.3.9 sid)
  • Revision ID: james.westby@ubuntu.com-20100204193057-d3018lm1fipb0703
* New upstream release
* debian/copyright:
- Updated with changes since 1.1.19.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
namespace WebCore {
36
36
    class File;
 
37
    class FileList;
 
38
    class SerializedArray;
 
39
    class SerializedFileList;
37
40
    class SerializedObject;
38
 
    class SerializedArray;
39
41
 
40
42
    class SharedSerializedData : public RefCounted<SharedSerializedData> {
41
43
    public:
42
44
        virtual ~SharedSerializedData() { }
43
45
        SerializedArray* asArray();
44
46
        SerializedObject* asObject();
 
47
        SerializedFileList* asFileList();
45
48
    };
46
49
 
47
50
    class SerializedScriptValue;
56
59
            ObjectType,
57
60
            ArrayType,
58
61
            StringType,
59
 
            FileType
 
62
            FileType,
 
63
            FileListType
60
64
        };
61
65
 
62
66
        SerializedType type() const { return m_type; }
63
67
        static SerializedScriptValueData serialize(JSC::ExecState*, JSC::JSValue);
64
 
        JSC::JSValue deserialize(JSC::ExecState*, bool mustCopy) const;
 
68
        JSC::JSValue deserialize(JSC::ExecState*, JSC::JSGlobalObject*, bool mustCopy) const;
65
69
 
66
70
        ~SerializedScriptValueData()
67
71
        {
81
85
        }
82
86
        
83
87
        explicit SerializedScriptValueData(const File*);
 
88
        explicit SerializedScriptValueData(const FileList*);
84
89
 
85
90
        explicit SerializedScriptValueData(JSC::JSValue value)
86
91
            : m_type(ImmediateType)
130
135
            return m_sharedData->asArray();
131
136
        }
132
137
 
 
138
        SerializedFileList* asFileList() const
 
139
        {
 
140
            ASSERT(m_type == FileListType);
 
141
            ASSERT(m_sharedData);
 
142
            return m_sharedData->asFileList();
 
143
        }
 
144
 
133
145
        operator bool() const { return m_type != EmptyType; }
134
146
 
135
147
        SerializedScriptValueData release()
184
196
            return m_value.asString();
185
197
        }
186
198
 
187
 
        JSC::JSValue deserialize(JSC::ExecState* exec)
 
199
        JSC::JSValue deserialize(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject)
188
200
        {
189
201
            if (!m_value)
190
202
                return JSC::jsNull();
191
 
            return m_value.deserialize(exec, m_mustCopy);
 
203
            return m_value.deserialize(exec, globalObject, m_mustCopy);
192
204
        }
193
205
 
194
206
        JSValueRef deserialize(JSContextRef, JSValueRef* exception);