1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_COMMON_SERIALIZED_SCRIPT_VALUE_H_
6 #define CONTENT_PUBLIC_COMMON_SERIALIZED_SCRIPT_VALUE_H_
8 #include "base/string16.h"
9 #include "content/common/content_export.h"
12 class WebSerializedScriptValue
;
17 class CONTENT_EXPORT SerializedScriptValue
{
19 SerializedScriptValue();
20 SerializedScriptValue(bool is_null
, bool is_invalid
, const string16
& data
);
21 explicit SerializedScriptValue(const WebKit::WebSerializedScriptValue
& value
);
23 void set_is_null(bool is_null
) { is_null_
= is_null
; }
24 bool is_null() const { return is_null_
; }
26 void set_is_invalid(bool is_invalid
) { is_invalid_
= is_invalid
; }
27 bool is_invalid() const { return is_invalid_
; }
29 void set_data(const string16
& data
) { data_
= data
; }
30 const string16
& data() const { return data_
; }
32 void set_web_serialized_script_value(
33 const WebKit::WebSerializedScriptValue
& value
);
35 operator WebKit::WebSerializedScriptValue() const;
38 bool is_null_
; // Is this null? If so, none of the other properties are valid.
39 bool is_invalid_
; // Is data_ valid?
40 string16 data_
; // The wire string format of the serialized script value.
43 } // namespace content
45 #endif // CONTENT_PUBLIC_COMMON_SERIALIZED_SCRIPT_VALUE_H_