Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: webkit/glue/glue_serialize.cc

Issue 7215027: Coverity: Initialize member variables. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698