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

Unified Diff: app/gfx/gl/gl_context_linux.cc

Issue 2804042: Incomplete changes to make scoped_ptr_malloc use plain functions. (Closed)
Patch Set: chrome now builds & links Created 10 years, 5 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 | « no previous file | base/crypto/scoped_nss_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gfx/gl/gl_context_linux.cc
diff --git a/app/gfx/gl/gl_context_linux.cc b/app/gfx/gl/gl_context_linux.cc
index 8701bc362c5e8212697290f744a8a4d4a55b6375..4a8946e2e63d0e04d0d40e2c5ff877bafef3d933 100644
--- a/app/gfx/gl/gl_context_linux.cc
+++ b/app/gfx/gl/gl_context_linux.cc
@@ -142,16 +142,6 @@ class PixmapGLContext : public GLContext {
DISALLOW_COPY_AND_ASSIGN(PixmapGLContext);
};
-// scoped_ptr functor for XFree(). Use as follows:
-// scoped_ptr_malloc<XVisualInfo, ScopedPtrXFree> foo(...);
-// where "XVisualInfo" is any X type that is freed with XFree.
-class ScopedPtrXFree {
- public:
- void operator()(void* x) const {
- ::XFree(x);
- }
-};
-
bool GLContext::InitializeOneOff() {
static bool initialized = false;
if (initialized)
@@ -199,7 +189,7 @@ bool ViewGLContext::Initialize(bool multisampled) {
XVisualInfo visual_info_template;
visual_info_template.visualid = XVisualIDFromVisual(attributes.visual);
int visual_info_count = 0;
- scoped_ptr_malloc<XVisualInfo, ScopedPtrXFree> visual_info_list(
+ scoped_ptr_malloc<XVisualInfo, FreeFnAdapterIgnoreReturn< ::XFree> > visual_info_list(
XGetVisualInfo(display, VisualIDMask,
&visual_info_template,
&visual_info_count));
@@ -480,7 +470,7 @@ bool PbufferGLContext::Initialize(GLContext* shared_context) {
int nelements = 0;
// TODO(kbr): figure out whether hardcoding screen to 0 is sufficient.
- scoped_ptr_malloc<GLXFBConfig, ScopedPtrXFree> config(
+ scoped_ptr_malloc<GLXFBConfig, FreeFnAdapterIgnoreReturn< ::XFree> > config(
glXChooseFBConfig(display, 0, config_attributes, &nelements));
if (!config.get()) {
LOG(ERROR) << "glXChooseFBConfig failed.";
@@ -599,7 +589,7 @@ bool PixmapGLContext::Initialize(GLContext* shared_context) {
Display* display = x11_util::GetXDisplay();
int screen = DefaultScreen(display);
- scoped_ptr_malloc<XVisualInfo, ScopedPtrXFree> visual_info(
+ scoped_ptr_malloc<XVisualInfo, FreeFnAdapterIgnoreReturn< ::XFree> > visual_info(
glXChooseVisual(display, screen, attributes));
if (!visual_info.get()) {
« no previous file with comments | « no previous file | base/crypto/scoped_nss_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698