| OLD | NEW |
| 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/x/x11_atom_cache.h" | 5 #include "ui/gfx/x/x11_atom_cache.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 XAtom X11AtomCache::GetAtom(const char* name) const { | 36 XAtom X11AtomCache::GetAtom(const char* name) const { |
| 37 std::map<std::string, Atom>::const_iterator it = cached_atoms_.find(name); | 37 std::map<std::string, Atom>::const_iterator it = cached_atoms_.find(name); |
| 38 | 38 |
| 39 if (uncached_atoms_allowed_ && it == cached_atoms_.end()) { | 39 if (uncached_atoms_allowed_ && it == cached_atoms_.end()) { |
| 40 XAtom atom = XInternAtom(xdisplay_, name, false); | 40 XAtom atom = XInternAtom(xdisplay_, name, false); |
| 41 cached_atoms_.insert(std::make_pair(name, atom)); | 41 cached_atoms_.insert(std::make_pair(name, atom)); |
| 42 return atom; | 42 return atom; |
| 43 } | 43 } |
| 44 | 44 |
| 45 CHECK(it != cached_atoms_.end()) << " Atom " << name << " not found"; | 45 // Atom |name| not found |
| 46 CHECK(it != cached_atoms_.end()); |
| 46 return it->second; | 47 return it->second; |
| 47 } | 48 } |
| 48 | 49 |
| 49 } // namespace ui | 50 } // namespace ui |
| OLD | NEW |