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

Side by Side Diff: content/common/cursors/webcursor_aurawin.cc

Issue 1406403007: Eliminate HICON leaks caused by creating icons from bitmap image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_truetype_font_win.cc ('k') | printing/emf_win.cc » ('j') | 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) 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 "content/common/cursors/webcursor.h" 5 #include "content/common/cursors/webcursor.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "third_party/WebKit/public/platform/WebCursorInfo.h" 9 #include "third_party/WebKit/public/platform/WebCursorInfo.h"
10 #include "ui/gfx/icon_util.h" 10 #include "ui/gfx/icon_util.h"
(...skipping 12 matching lines...) Expand all
23 CreateScaledBitmapAndHotspotFromCustomData(&bitmap, &hotspot); 23 CreateScaledBitmapAndHotspotFromCustomData(&bitmap, &hotspot);
24 24
25 gfx::Size custom_size; 25 gfx::Size custom_size;
26 std::vector<char> custom_data; 26 std::vector<char> custom_data;
27 CreateCustomData(bitmap, &custom_data, &custom_size); 27 CreateCustomData(bitmap, &custom_data, &custom_size);
28 28
29 custom_cursor_ = IconUtil::CreateCursorFromDIB( 29 custom_cursor_ = IconUtil::CreateCursorFromDIB(
30 custom_size, 30 custom_size,
31 hotspot, 31 hotspot,
32 !custom_data.empty() ? &custom_data[0] : NULL, 32 !custom_data.empty() ? &custom_data[0] : NULL,
33 custom_data.size()); 33 custom_data.size())
34 .release();
34 return custom_cursor_; 35 return custom_cursor_;
35 } 36 }
36 37
37 void WebCursor::InitPlatformData() { 38 void WebCursor::InitPlatformData() {
38 custom_cursor_ = NULL; 39 custom_cursor_ = NULL;
39 } 40 }
40 41
41 bool WebCursor::SerializePlatformData(base::Pickle* pickle) const { 42 bool WebCursor::SerializePlatformData(base::Pickle* pickle) const {
42 return true; 43 return true;
43 } 44 }
(...skipping 10 matching lines...) Expand all
54 if (custom_cursor_) { 55 if (custom_cursor_) {
55 DestroyIcon(custom_cursor_); 56 DestroyIcon(custom_cursor_);
56 custom_cursor_ = NULL; 57 custom_cursor_ = NULL;
57 } 58 }
58 } 59 }
59 60
60 void WebCursor::CopyPlatformData(const WebCursor& other) { 61 void WebCursor::CopyPlatformData(const WebCursor& other) {
61 } 62 }
62 63
63 } // namespace content 64 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_truetype_font_win.cc ('k') | printing/emf_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698