| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/serialized_script_value.h" | 5 #include "chrome/common/serialized_script_value.h" |
| 6 | 6 |
| 7 #include "third_party/WebKit/WebKit/chromium/public/WebSerializedScriptValue.h" |
| 7 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 8 | 9 |
| 9 using WebKit::WebSerializedScriptValue; | 10 using WebKit::WebSerializedScriptValue; |
| 10 | 11 |
| 11 SerializedScriptValue::SerializedScriptValue() | 12 SerializedScriptValue::SerializedScriptValue() |
| 12 : is_null_(true), | 13 : is_null_(true), |
| 13 is_invalid_(false) { | 14 is_invalid_(false) { |
| 14 } | 15 } |
| 15 | 16 |
| 16 SerializedScriptValue::SerializedScriptValue( | 17 SerializedScriptValue::SerializedScriptValue( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 32 return WebSerializedScriptValue::createInvalid(); | 33 return WebSerializedScriptValue::createInvalid(); |
| 33 return WebSerializedScriptValue::fromString(data_); | 34 return WebSerializedScriptValue::fromString(data_); |
| 34 } | 35 } |
| 35 | 36 |
| 36 void SerializedScriptValue::set_web_serialized_script_value( | 37 void SerializedScriptValue::set_web_serialized_script_value( |
| 37 const WebSerializedScriptValue& value) { | 38 const WebSerializedScriptValue& value) { |
| 38 is_null_ = value.isNull(); | 39 is_null_ = value.isNull(); |
| 39 is_invalid_ = value.isNull() ? false : value.toString().isNull(); | 40 is_invalid_ = value.isNull() ? false : value.toString().isNull(); |
| 40 data_ = value.isNull() ? string16() : static_cast<string16>(value.toString()); | 41 data_ = value.isNull() ? string16() : static_cast<string16>(value.toString()); |
| 41 } | 42 } |
| OLD | NEW |