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

Unified Diff: ui/base/x/x11_util.cc

Issue 2914103002: Remove usages of XInternAtom (Closed)
Patch Set: Address sadrul and sergeyu comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/selection_utils.cc ('k') | ui/display/manager/chromeos/x11/native_display_delegate_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 834eff6386b0e4bd7d796aec4381e9b6a989c113..bf3231c2e8d3375dfabc6ab52550deb7436acfa8 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -57,6 +57,7 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/skia_util.h"
+#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/x11_error_tracker.h"
#if defined(OS_FREEBSD)
@@ -894,8 +895,7 @@ bool SetStringProperty(XID window,
}
XAtom GetAtom(const char* name) {
- // TODO(derat): Cache atoms to avoid round-trips to the server.
- return XInternAtom(gfx::GetXDisplay(), name, false);
+ return X11AtomCache::GetInstance()->GetAtom(name);
}
void SetWindowClassHint(XDisplay* display,
@@ -1391,7 +1391,7 @@ XVisualManager::XVisualManager()
for (int i = 0; i < visuals_len; ++i)
visuals_[visual_list[i].visualid].reset(new XVisualData(visual_list[i]));
- XAtom NET_WM_CM_S0 = XInternAtom(display_, "_NET_WM_CM_S0", False);
+ XAtom NET_WM_CM_S0 = GetAtom("_NET_WM_CM_S0");
using_compositing_wm_ = XGetSelectionOwner(display_, NET_WM_CM_S0) != None;
// Choose the opaque visual.
« no previous file with comments | « ui/base/x/selection_utils.cc ('k') | ui/display/manager/chromeos/x11/native_display_delegate_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698