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

Side by Side Diff: ui/gfx/color_profile_win.cc

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/gfx/color_profile_mac.mm ('k') | ui/gfx/color_utils.h » ('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/gfx/color_profile.h" 5 #include "ui/gfx/color_profile.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stddef.h>
8 #include <map> 9 #include <map>
9 10
10 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
11 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/macros.h"
12 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
13 15
14 namespace gfx { 16 namespace gfx {
15 17
16 class ColorProfileCache { 18 class ColorProfileCache {
17 public: 19 public:
18 // A thread-safe cache of color profiles keyed by windows device name. 20 // A thread-safe cache of color profiles keyed by windows device name.
19 ColorProfileCache() {} 21 ColorProfileCache() {}
20 22
21 bool Find(const std::wstring& device, std::vector<char>* profile) { 23 bool Find(const std::wstring& device, std::vector<char>* profile) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 std::string profileData; 114 std::string profileData;
113 if (!base::ReadFileToString(base::FilePath(path), &profileData)) 115 if (!base::ReadFileToString(base::FilePath(path), &profileData))
114 return; 116 return;
115 size_t length = profileData.size(); 117 size_t length = profileData.size();
116 if (gfx::InvalidColorProfileLength(length)) 118 if (gfx::InvalidColorProfileLength(length))
117 return; 119 return;
118 profile->assign(profileData.data(), profileData.data() + length); 120 profile->assign(profileData.data(), profileData.data() + length);
119 } 121 }
120 122
121 } // namespace gfx 123 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/color_profile_mac.mm ('k') | ui/gfx/color_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698