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

Unified Diff: webkit/glue/webcursor.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jar feedback Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webkit/glue/webcursor.cc
diff --git a/webkit/glue/webcursor.cc b/webkit/glue/webcursor.cc
index 292ca0db8e895bdacd85d2fe6e34410a6326298e..bf16ebaeb27d6cc86504832eb9a362b04f9a60ef 100644
--- a/webkit/glue/webcursor.cc
+++ b/webkit/glue/webcursor.cc
@@ -70,18 +70,18 @@ void WebCursor::GetCursorInfo(WebCursorInfo* cursor_info) const {
#endif
}
-bool WebCursor::Deserialize(const Pickle* pickle, void** iter) {
+bool WebCursor::Deserialize(PickleReader* iter) {
int type, hotspot_x, hotspot_y, size_x, size_y, data_len;
const char* data;
// Leave |this| unmodified unless we are going to return success.
- if (!pickle->ReadInt(iter, &type) ||
- !pickle->ReadInt(iter, &hotspot_x) ||
- !pickle->ReadInt(iter, &hotspot_y) ||
- !pickle->ReadLength(iter, &size_x) ||
- !pickle->ReadLength(iter, &size_y) ||
- !pickle->ReadData(iter, &data, &data_len))
+ if (!iter->ReadInt(&type) ||
+ !iter->ReadInt(&hotspot_x) ||
+ !iter->ReadInt(&hotspot_y) ||
+ !iter->ReadLength(&size_x) ||
+ !iter->ReadLength(&size_y) ||
+ !iter->ReadData(&data, &data_len))
return false;
// Ensure the size is sane, and there is enough data.
@@ -111,7 +111,7 @@ bool WebCursor::Deserialize(const Pickle* pickle, void** iter) {
}
}
}
- return DeserializePlatformData(pickle, iter);
+ return DeserializePlatformData(iter);
}
bool WebCursor::Serialize(Pickle* pickle) const {

Powered by Google App Engine
This is Rietveld 408576698