| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/glue/glue_serialize.h" | 5 #include "webkit/glue/glue_serialize.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using WebKit::WebPoint; | 25 using WebKit::WebPoint; |
| 26 using WebKit::WebSerializedScriptValue; | 26 using WebKit::WebSerializedScriptValue; |
| 27 using WebKit::WebString; | 27 using WebKit::WebString; |
| 28 using WebKit::WebUChar; | 28 using WebKit::WebUChar; |
| 29 using WebKit::WebVector; | 29 using WebKit::WebVector; |
| 30 | 30 |
| 31 namespace webkit_glue { | 31 namespace webkit_glue { |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 struct SerializeObject { | 34 struct SerializeObject { |
| 35 SerializeObject() : iter(NULL) {} | 35 SerializeObject() : iter(NULL), version(0) {} |
| 36 SerializeObject(const char* data, int len) : pickle(data, len), iter(NULL) {} | 36 SerializeObject(const char* data, int len) |
| 37 : pickle(data, len), iter(NULL), version(0) {} |
| 37 | 38 |
| 38 std::string GetAsString() { | 39 std::string GetAsString() { |
| 39 return std::string(static_cast<const char*>(pickle.data()), pickle.size()); | 40 return std::string(static_cast<const char*>(pickle.data()), pickle.size()); |
| 40 } | 41 } |
| 41 | 42 |
| 42 Pickle pickle; | 43 Pickle pickle; |
| 43 mutable void* iter; | 44 mutable void* iter; |
| 44 mutable int version; | 45 mutable int version; |
| 45 }; | 46 }; |
| 46 | 47 |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 kVersion = version; | 499 kVersion = version; |
| 499 | 500 |
| 500 SerializeObject obj; | 501 SerializeObject obj; |
| 501 WriteHistoryItem(item, &obj); | 502 WriteHistoryItem(item, &obj); |
| 502 *serialized_item = obj.GetAsString(); | 503 *serialized_item = obj.GetAsString(); |
| 503 | 504 |
| 504 kVersion = real_version; | 505 kVersion = real_version; |
| 505 } | 506 } |
| 506 | 507 |
| 507 } // namespace webkit_glue | 508 } // namespace webkit_glue |
| OLD | NEW |