Chromium Code Reviews| 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 #include "base/logging.h" | |
| 8 | |
| 9 namespace gfx { | |
| 10 | |
| 11 void ColorProfile::GetColorProfile(gfx::NativeViewId parent_window, | |
| 12 std::vector<char>* profile) { | |
| 13 // Called from the FILE thread on Windows and IO thread elsewhere. | |
| 14 // Force data to leak so exit time destructors are not called. | |
| 15 static std::map<gfx::NativeViewId, std::vector<char> >& data = | |
| 16 *new std::map<gfx::NativeViewId, std::vector<char> >(); | |
| 17 | |
|
Noel Gordon
2012/06/21 16:58:33
You could add a DCHECK(!parent_window) here, becau
tpayne
2012/07/02 19:22:32
Done.
| |
| 18 profile->clear(); | |
| 19 std::vector<char> stored_profile; | |
| 20 if (data.find(parent_window) == data.end()) { | |
| 21 ReadProfile(parent_window, &stored_profile); | |
| 22 data[parent_window] = stored_profile; | |
| 23 } | |
| 24 | |
| 25 profile->assign(data[parent_window].begin(), data[parent_window].end()); | |
| 26 } | |
| 27 | |
| 28 } // namespace gfx | |
| OLD | NEW |