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

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

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 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
« no previous file with comments | « webkit/glue/webcursor_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/pickle.h" 6 #include "base/pickle.h"
7 #include "grit/webkit_resources.h" 7 #include "grit/webkit_resources.h"
8 #include "third_party/skia/include/core/SkBitmap.h" 8 #include "third_party/skia/include/core/SkBitmap.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
10 #include "ui/gfx/gdi_util.h" 10 #include "ui/gfx/gdi_util.h"
11 #include "webkit/glue/webcursor.h" 11 #include "webkit/glue/webcursor.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 custom_cursor_ = NULL; 209 custom_cursor_ = NULL;
210 } 210 }
211 211
212 bool WebCursor::SerializePlatformData(Pickle* pickle) const { 212 bool WebCursor::SerializePlatformData(Pickle* pickle) const {
213 // There are some issues with converting certain HCURSORS to bitmaps. The 213 // There are some issues with converting certain HCURSORS to bitmaps. The
214 // HCURSOR being a user object can be marshaled as is. 214 // HCURSOR being a user object can be marshaled as is.
215 // HCURSORs are always 32 bits on Windows, even on 64 bit systems. 215 // HCURSORs are always 32 bits on Windows, even on 64 bit systems.
216 return pickle->WriteUInt32(reinterpret_cast<uint32>(external_cursor_)); 216 return pickle->WriteUInt32(reinterpret_cast<uint32>(external_cursor_));
217 } 217 }
218 218
219 bool WebCursor::DeserializePlatformData(const Pickle* pickle, void** iter) { 219 bool WebCursor::DeserializePlatformData(PickleIterator* iter) {
220 return pickle->ReadUInt32(iter, reinterpret_cast<uint32*>(&external_cursor_)); 220 return iter->ReadUInt32(reinterpret_cast<uint32*>(&external_cursor_));
221 } 221 }
222 222
223 bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const { 223 bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const {
224 if (!IsCustom()) 224 if (!IsCustom())
225 return true; 225 return true;
226 226
227 return (external_cursor_ == other.external_cursor_); 227 return (external_cursor_ == other.external_cursor_);
228 } 228 }
229 229
230 void WebCursor::CopyPlatformData(const WebCursor& other) { 230 void WebCursor::CopyPlatformData(const WebCursor& other) {
231 external_cursor_ = other.external_cursor_; 231 external_cursor_ = other.external_cursor_;
232 // The custom_cursor_ member will be initialized to a HCURSOR the next time 232 // The custom_cursor_ member will be initialized to a HCURSOR the next time
233 // the GetCursor member function is invoked on this WebCursor instance. The 233 // the GetCursor member function is invoked on this WebCursor instance. The
234 // cursor is created using the data in the custom_data_ vector. 234 // cursor is created using the data in the custom_data_ vector.
235 custom_cursor_ = NULL; 235 custom_cursor_ = NULL;
236 } 236 }
237 237
238 void WebCursor::CleanupPlatformData() { 238 void WebCursor::CleanupPlatformData() {
239 external_cursor_ = NULL; 239 external_cursor_ = NULL;
240 240
241 if (custom_cursor_) { 241 if (custom_cursor_) {
242 DestroyIcon(custom_cursor_); 242 DestroyIcon(custom_cursor_);
243 custom_cursor_ = NULL; 243 custom_cursor_ = NULL;
244 } 244 }
245 } 245 }
OLDNEW
« no previous file with comments | « webkit/glue/webcursor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698