OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "color_profile.h" | |
6 | |
7 namespace gfx { | |
8 | |
9 void ColorProfile::GetColorProfile(gfx::NativeViewId parent_hwnd, | |
10 std::vector<char>* profile) { | |
11 // Force data to leak so exit time destructors are not called. | |
12 static std::map<gfx::NativeViewId, std::vector<char> >& data = | |
13 *new std::map<gfx::NativeViewId, std::vector<char> >(); | |
tony
2012/06/14 23:18:10
Nit: Can you use CR_DEFINE_STATIC_LOCAL?
tpayne
2012/06/14 23:19:09
I couldn't get that to parse correctly because of
| |
14 | |
15 profile->clear(); | |
16 std::vector<char> stored_profile; | |
17 if (data.find(parent_hwnd) == data.end()) { | |
18 ReadProfile(parent_hwnd, &stored_profile); | |
19 data[parent_hwnd] = stored_profile; | |
20 } | |
21 | |
22 profile->assign(data[parent_hwnd].begin(), data[parent_hwnd].end()); | |
23 } | |
24 | |
25 } // namespace gfx | |
OLD | NEW |