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

Side by Side Diff: ui/base/cursor/cursor.cc

Issue 10928154: Fix incorrect use of UnrefCustomCursor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check if platform_cursor_ is non-zero in {Ref/Unref}CustomCursor. Created 8 years, 3 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 | « no previous file | ui/base/cursor/cursor_x11.cc » ('j') | ui/base/cursor/cursor_x11.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 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 "ui/base/cursor/cursor.h" 5 #include "ui/base/cursor/cursor.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 Cursor::Cursor() 9 Cursor::Cursor()
10 : native_type_(0), 10 : native_type_(0),
(...skipping 24 matching lines...) Expand all
35 if (native_type_ == kCursorCustom) 35 if (native_type_ == kCursorCustom)
36 UnrefCustomCursor(); 36 UnrefCustomCursor();
37 platform_cursor_ = platform; 37 platform_cursor_ = platform;
38 if (native_type_ == kCursorCustom) 38 if (native_type_ == kCursorCustom)
39 RefCustomCursor(); 39 RefCustomCursor();
40 } 40 }
41 41
42 void Cursor::Assign(const Cursor& cursor) { 42 void Cursor::Assign(const Cursor& cursor) {
43 if (*this == cursor) 43 if (*this == cursor)
44 return; 44 return;
45 native_type_ = cursor.native_type_;
46 if (native_type_ == kCursorCustom) 45 if (native_type_ == kCursorCustom)
47 UnrefCustomCursor(); 46 UnrefCustomCursor();
47 native_type_ = cursor.native_type_;
48 platform_cursor_ = cursor.platform_cursor_; 48 platform_cursor_ = cursor.platform_cursor_;
49 if (native_type_ == kCursorCustom) 49 if (native_type_ == kCursorCustom)
50 RefCustomCursor(); 50 RefCustomCursor();
51 device_scale_factor_ = cursor.device_scale_factor_; 51 device_scale_factor_ = cursor.device_scale_factor_;
52 } 52 }
53 53
54 } // namespace ui 54 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/base/cursor/cursor_x11.cc » ('j') | ui/base/cursor/cursor_x11.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698