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

Side by Side Diff: ui/base/resource/resource_data_dll_win.cc

Issue 126103003: Changed RefCountedStaticMemory() to accept a void pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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 unified diff | Download patch
« no previous file with comments | « ui/base/resource/resource_bundle_gtk.cc ('k') | ui/gfx/icon_util.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 "ui/base/resource/resource_data_dll_win.h" 5 #include "ui/base/resource/resource_data_dll_win.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/win/resource_util.h" 9 #include "base/win/resource_util.h"
10 10
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 return false; 41 return false;
42 } 42 }
43 43
44 base::RefCountedStaticMemory* ResourceDataDLL::GetStaticMemory( 44 base::RefCountedStaticMemory* ResourceDataDLL::GetStaticMemory(
45 uint16 resource_id) const { 45 uint16 resource_id) const {
46 void* data_ptr; 46 void* data_ptr;
47 size_t data_size; 47 size_t data_size;
48 if (base::win::GetDataResourceFromModule(module_, resource_id, &data_ptr, 48 if (base::win::GetDataResourceFromModule(module_, resource_id, &data_ptr,
49 &data_size)) { 49 &data_size)) {
50 return new base::RefCountedStaticMemory( 50 return new base::RefCountedStaticMemory(data_ptr, data_size);
51 reinterpret_cast<const unsigned char*>(data_ptr), data_size);
52 } 51 }
53 return NULL; 52 return NULL;
54 } 53 }
55 54
56 ResourceHandle::TextEncodingType ResourceDataDLL::GetTextEncodingType() const { 55 ResourceHandle::TextEncodingType ResourceDataDLL::GetTextEncodingType() const {
57 return BINARY; 56 return BINARY;
58 } 57 }
59 58
60 ScaleFactor ResourceDataDLL::GetScaleFactor() const { 59 ScaleFactor ResourceDataDLL::GetScaleFactor() const {
61 return ui::SCALE_FACTOR_NONE; 60 return ui::SCALE_FACTOR_NONE;
62 } 61 }
63 62
64 } // namespace ui 63 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_gtk.cc ('k') | ui/gfx/icon_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698