Commit ab9327cc authored by rsleevi@chromium.org's avatar rsleevi@chromium.org

RefCounted types should not have public destructors, printing/ and ui/

BUG=123295
TEST=none


Review URL: http://codereview.chromium.org/10067034

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134859 0039d316-1c4b-4281-b951-d872f2087c98
parent 1b29524a
...@@ -53,8 +53,6 @@ struct PRINTING_EXPORT PrinterCapsAndDefaults { ...@@ -53,8 +53,6 @@ struct PRINTING_EXPORT PrinterCapsAndDefaults {
class PRINTING_EXPORT PrintBackend class PRINTING_EXPORT PrintBackend
: public base::RefCountedThreadSafe<PrintBackend> { : public base::RefCountedThreadSafe<PrintBackend> {
public: public:
virtual ~PrintBackend();
// Enumerates the list of installed local and network printers. // Enumerates the list of installed local and network printers.
virtual bool EnumeratePrinters(PrinterList* printer_list) = 0; virtual bool EnumeratePrinters(PrinterList* printer_list) = 0;
...@@ -78,6 +76,10 @@ class PRINTING_EXPORT PrintBackend ...@@ -78,6 +76,10 @@ class PRINTING_EXPORT PrintBackend
// Return NULL if no print backend available. // Return NULL if no print backend available.
static scoped_refptr<PrintBackend> CreateInstance( static scoped_refptr<PrintBackend> CreateInstance(
const base::DictionaryValue* print_backend_settings); const base::DictionaryValue* print_backend_settings);
protected:
friend class base::RefCountedThreadSafe<PrintBackend>;
virtual ~PrintBackend();
}; };
} // namespace printing } // namespace printing
......
...@@ -12,21 +12,19 @@ namespace printing { ...@@ -12,21 +12,19 @@ namespace printing {
class PrintBackendChromeOS : public PrintBackend { class PrintBackendChromeOS : public PrintBackend {
public: public:
PrintBackendChromeOS(); PrintBackendChromeOS();
virtual ~PrintBackendChromeOS() {}
// PrintBackend implementation. // PrintBackend implementation.
virtual bool EnumeratePrinters(PrinterList* printer_list); virtual bool EnumeratePrinters(PrinterList* printer_list) OVERRIDE;
virtual std::string GetDefaultPrinterName() OVERRIDE;
virtual std::string GetDefaultPrinterName(); virtual bool GetPrinterCapsAndDefaults(
const std::string& printer_name,
virtual bool GetPrinterCapsAndDefaults(const std::string& printer_name, PrinterCapsAndDefaults* printer_info) OVERRIDE;
PrinterCapsAndDefaults* printer_info); virtual std::string GetPrinterDriverInfo(
const std::string& printer_name) OVERRIDE;
virtual std::string GetPrinterDriverInfo(const std::string& printer_name); virtual bool IsValidPrinter(const std::string& printer_name) OVERRIDE;
virtual bool IsValidPrinter(const std::string& printer_name);
private: protected:
virtual ~PrintBackendChromeOS() {}
}; };
PrintBackendChromeOS::PrintBackendChromeOS() {} PrintBackendChromeOS::PrintBackendChromeOS() {}
......
...@@ -103,22 +103,20 @@ static const char kCUPSPrinterMakeModelOpt[] = "printer-make-and-model"; ...@@ -103,22 +103,20 @@ static const char kCUPSPrinterMakeModelOpt[] = "printer-make-and-model";
class PrintBackendCUPS : public PrintBackend { class PrintBackendCUPS : public PrintBackend {
public: public:
PrintBackendCUPS(const GURL& print_server_url, bool blocking); PrintBackendCUPS(const GURL& print_server_url, bool blocking);
virtual ~PrintBackendCUPS() {}
// PrintBackend implementation. // PrintBackend implementation.
virtual bool EnumeratePrinters(PrinterList* printer_list) OVERRIDE; virtual bool EnumeratePrinters(PrinterList* printer_list) OVERRIDE;
virtual std::string GetDefaultPrinterName() OVERRIDE; virtual std::string GetDefaultPrinterName() OVERRIDE;
virtual bool GetPrinterCapsAndDefaults( virtual bool GetPrinterCapsAndDefaults(
const std::string& printer_name, const std::string& printer_name,
PrinterCapsAndDefaults* printer_info) OVERRIDE; PrinterCapsAndDefaults* printer_info) OVERRIDE;
virtual std::string GetPrinterDriverInfo( virtual std::string GetPrinterDriverInfo(
const std::string& printer_name) OVERRIDE; const std::string& printer_name) OVERRIDE;
virtual bool IsValidPrinter(const std::string& printer_name) OVERRIDE; virtual bool IsValidPrinter(const std::string& printer_name) OVERRIDE;
protected:
virtual ~PrintBackendCUPS() {}
private: private:
// Following functions are wrappers around corresponding CUPS functions. // Following functions are wrappers around corresponding CUPS functions.
// <functions>2() are called when print server is specified, and plain // <functions>2() are called when print server is specified, and plain
......
...@@ -38,18 +38,19 @@ namespace printing { ...@@ -38,18 +38,19 @@ namespace printing {
class PrintBackendWin : public PrintBackend { class PrintBackendWin : public PrintBackend {
public: public:
PrintBackendWin() {} PrintBackendWin() {}
virtual ~PrintBackendWin() {}
virtual bool EnumeratePrinters(PrinterList* printer_list);
virtual std::string GetDefaultPrinterName();
virtual bool GetPrinterCapsAndDefaults(const std::string& printer_name, // PrintBackend implementation.
PrinterCapsAndDefaults* printer_info); virtual bool EnumeratePrinters(PrinterList* printer_list) OVERRIDE;
virtual std::string GetDefaultPrinterName() OVERRIDE;
virtual std::string GetPrinterDriverInfo(const std::string& printer_name); virtual bool GetPrinterCapsAndDefaults(
const std::string& printer_name,
PrinterCapsAndDefaults* printer_info) OVERRIDE;
virtual std::string GetPrinterDriverInfo(
const std::string& printer_name) OVERRIDE;
virtual bool IsValidPrinter(const std::string& printer_name) OVERRIDE;
virtual bool IsValidPrinter(const std::string& printer_name); protected:
virtual ~PrintBackendWin() {}
}; };
bool PrintBackendWin::EnumeratePrinters(PrinterList* printer_list) { bool PrintBackendWin::EnumeratePrinters(PrinterList* printer_list) {
......
...@@ -38,7 +38,7 @@ class Layer; ...@@ -38,7 +38,7 @@ class Layer;
// a global object. // a global object.
class COMPOSITOR_EXPORT ContextFactory { class COMPOSITOR_EXPORT ContextFactory {
public: public:
virtual ~ContextFactory() { } virtual ~ContextFactory() {}
// Gets the global instance. // Gets the global instance.
static ContextFactory* GetInstance(); static ContextFactory* GetInstance();
...@@ -97,14 +97,18 @@ class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory { ...@@ -97,14 +97,18 @@ class COMPOSITOR_EXPORT DefaultContextFactory : public ContextFactory {
class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> { class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> {
public: public:
Texture(bool flipped, const gfx::Size& size); Texture(bool flipped, const gfx::Size& size);
virtual ~Texture();
unsigned int texture_id() const { return texture_id_; } unsigned int texture_id() const { return texture_id_; }
void set_texture_id(unsigned int id) { texture_id_ = id; } void set_texture_id(unsigned int id) { texture_id_ = id; }
bool flipped() const { return flipped_; } bool flipped() const { return flipped_; }
gfx::Size size() const { return size_; } gfx::Size size() const { return size_; }
protected:
virtual ~Texture();
private: private:
friend class base::RefCounted<Texture>;
unsigned int texture_id_; unsigned int texture_id_;
bool flipped_; bool flipped_;
gfx::Size size_; gfx::Size size_;
......
...@@ -21,12 +21,8 @@ GLContextCGL::GLContextCGL(GLShareGroup* share_group) ...@@ -21,12 +21,8 @@ GLContextCGL::GLContextCGL(GLShareGroup* share_group)
gpu_preference_(PreferIntegratedGpu) { gpu_preference_(PreferIntegratedGpu) {
} }
GLContextCGL::~GLContextCGL() { bool GLContextCGL::Initialize(GLSurface* compatible_surface,
Destroy(); GpuPreference gpu_preference) {
}
bool GLContextCGL::Initialize(
GLSurface* compatible_surface, GpuPreference gpu_preference) {
DCHECK(compatible_surface); DCHECK(compatible_surface);
GLContextCGL* share_context = share_group() ? GLContextCGL* share_context = share_group() ?
...@@ -144,6 +140,10 @@ void GLContextCGL::SetSwapInterval(int interval) { ...@@ -144,6 +140,10 @@ void GLContextCGL::SetSwapInterval(int interval) {
LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored."; LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored.";
} }
GLContextCGL::~GLContextCGL() {
Destroy();
}
GpuPreference GLContextCGL::GetGpuPreference() { GpuPreference GLContextCGL::GetGpuPreference() {
return gpu_preference_; return gpu_preference_;
} }
......
...@@ -12,11 +12,10 @@ class GLSurface; ...@@ -12,11 +12,10 @@ class GLSurface;
class GLContextCGL : public GLContext { class GLContextCGL : public GLContext {
public: public:
explicit GLContextCGL(GLShareGroup* share_group); explicit GLContextCGL(GLShareGroup* share_group);
virtual ~GLContextCGL();
// Implement GLContext. // Implement GLContext.
virtual bool Initialize( virtual bool Initialize(GLSurface* compatible_surface,
GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; GpuPreference gpu_preference) OVERRIDE;
virtual void Destroy() OVERRIDE; virtual void Destroy() OVERRIDE;
virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
...@@ -24,12 +23,12 @@ class GLContextCGL : public GLContext { ...@@ -24,12 +23,12 @@ class GLContextCGL : public GLContext {
virtual void* GetHandle() OVERRIDE; virtual void* GetHandle() OVERRIDE;
virtual void SetSwapInterval(int interval) OVERRIDE; virtual void SetSwapInterval(int interval) OVERRIDE;
// Expose ForceUseOfDiscreteGPU only to GLContext implementation. protected:
friend class GLContext; virtual ~GLContextCGL();
private: private:
void* context_; // Expose ForceUseOfDiscreteGPU only to GLContext implementation.
GpuPreference gpu_preference_; friend class GLContext;
GpuPreference GetGpuPreference(); GpuPreference GetGpuPreference();
...@@ -37,6 +36,9 @@ class GLContextCGL : public GLContext { ...@@ -37,6 +36,9 @@ class GLContextCGL : public GLContext {
// for stability reasons. // for stability reasons.
static void ForceUseOfDiscreteGPU(); static void ForceUseOfDiscreteGPU();
void* context_;
GpuPreference gpu_preference_;
DISALLOW_COPY_AND_ASSIGN(GLContextCGL); DISALLOW_COPY_AND_ASSIGN(GLContextCGL);
}; };
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -18,12 +18,8 @@ GLContextOSMesa::GLContextOSMesa(GLShareGroup* share_group) ...@@ -18,12 +18,8 @@ GLContextOSMesa::GLContextOSMesa(GLShareGroup* share_group)
context_(NULL) { context_(NULL) {
} }
GLContextOSMesa::~GLContextOSMesa() { bool GLContextOSMesa::Initialize(GLSurface* compatible_surface,
Destroy(); GpuPreference gpu_preference) {
}
bool GLContextOSMesa::Initialize(
GLSurface* compatible_surface, GpuPreference gpu_preference) {
DCHECK(!context_); DCHECK(!context_);
OSMesaContext share_handle = static_cast<OSMesaContext>( OSMesaContext share_handle = static_cast<OSMesaContext>(
...@@ -127,4 +123,8 @@ void GLContextOSMesa::SetSwapInterval(int interval) { ...@@ -127,4 +123,8 @@ void GLContextOSMesa::SetSwapInterval(int interval) {
LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored.";
} }
GLContextOSMesa::~GLContextOSMesa() {
Destroy();
}
} // namespace gfx } // namespace gfx
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -19,11 +19,10 @@ class GLSurface; ...@@ -19,11 +19,10 @@ class GLSurface;
class GLContextOSMesa : public GLContext { class GLContextOSMesa : public GLContext {
public: public:
explicit GLContextOSMesa(GLShareGroup* share_group); explicit GLContextOSMesa(GLShareGroup* share_group);
virtual ~GLContextOSMesa();
// Implement GLContext. // Implement GLContext.
virtual bool Initialize( virtual bool Initialize(GLSurface* compatible_surface,
GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; GpuPreference gpu_preference) OVERRIDE;
virtual void Destroy() OVERRIDE; virtual void Destroy() OVERRIDE;
virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
...@@ -31,6 +30,9 @@ class GLContextOSMesa : public GLContext { ...@@ -31,6 +30,9 @@ class GLContextOSMesa : public GLContext {
virtual void* GetHandle() OVERRIDE; virtual void* GetHandle() OVERRIDE;
virtual void SetSwapInterval(int interval) OVERRIDE; virtual void SetSwapInterval(int interval) OVERRIDE;
protected:
virtual ~GLContextOSMesa();
private: private:
OSMesaContext context_; OSMesaContext context_;
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -6,19 +6,14 @@ ...@@ -6,19 +6,14 @@
namespace gfx { namespace gfx {
GLContextStub::GLContextStub() : GLContext(NULL) { GLContextStub::GLContextStub() : GLContext(NULL) {}
}
GLContextStub::~GLContextStub() {
}
bool GLContextStub::Initialize( bool GLContextStub::Initialize(
GLSurface* compatible_surface, GpuPreference gpu_preference) { GLSurface* compatible_surface, GpuPreference gpu_preference) {
return true; return true;
} }
void GLContextStub::Destroy() { void GLContextStub::Destroy() {}
}
bool GLContextStub::MakeCurrent(GLSurface* surface) { bool GLContextStub::MakeCurrent(GLSurface* surface) {
SetCurrent(this, surface); SetCurrent(this, surface);
...@@ -43,4 +38,6 @@ std::string GLContextStub::GetExtensions() { ...@@ -43,4 +38,6 @@ std::string GLContextStub::GetExtensions() {
return std::string(); return std::string();
} }
GLContextStub::~GLContextStub() {}
} // namespace gfx } // namespace gfx
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -14,11 +14,10 @@ namespace gfx { ...@@ -14,11 +14,10 @@ namespace gfx {
class GL_EXPORT GLContextStub : public GLContext { class GL_EXPORT GLContextStub : public GLContext {
public: public:
GLContextStub(); GLContextStub();
virtual ~GLContextStub();
// Implement GLContext. // Implement GLContext.
virtual bool Initialize( virtual bool Initialize(GLSurface* compatible_surface,
GLSurface* compatible_surface, GpuPreference gpu_preference) OVERRIDE; GpuPreference gpu_preference) OVERRIDE;
virtual void Destroy() OVERRIDE; virtual void Destroy() OVERRIDE;
virtual bool MakeCurrent(GLSurface* surface) OVERRIDE; virtual bool MakeCurrent(GLSurface* surface) OVERRIDE;
virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE; virtual void ReleaseCurrent(GLSurface* surface) OVERRIDE;
...@@ -27,6 +26,9 @@ class GL_EXPORT GLContextStub : public GLContext { ...@@ -27,6 +26,9 @@ class GL_EXPORT GLContextStub : public GLContext {
virtual void SetSwapInterval(int interval) OVERRIDE; virtual void SetSwapInterval(int interval) OVERRIDE;
virtual std::string GetExtensions() OVERRIDE; virtual std::string GetExtensions() OVERRIDE;
protected:
virtual ~GLContextStub();
private: private:
DISALLOW_COPY_AND_ASSIGN(GLContextStub); DISALLOW_COPY_AND_ASSIGN(GLContextStub);
}; };
......
...@@ -70,13 +70,7 @@ bool GLSurface::InitializeOneOff() { ...@@ -70,13 +70,7 @@ bool GLSurface::InitializeOneOff() {
return initialized; return initialized;
} }
GLSurface::GLSurface() { GLSurface::GLSurface() {}
}
GLSurface::~GLSurface() {
if (GetCurrent() == this)
SetCurrent(NULL);
}
bool GLSurface::Initialize() bool GLSurface::Initialize()
{ {
...@@ -134,15 +128,16 @@ GLSurface* GLSurface::GetCurrent() { ...@@ -134,15 +128,16 @@ GLSurface* GLSurface::GetCurrent() {
return current_surface_.Pointer()->Get(); return current_surface_.Pointer()->Get();
} }
void GLSurface::SetCurrent(GLSurface* surface) { GLSurface::~GLSurface() {
current_surface_.Pointer()->Set(surface); if (GetCurrent() == this)
SetCurrent(NULL);
} }
GLSurfaceAdapter::GLSurfaceAdapter(GLSurface* surface) : surface_(surface) { void GLSurface::SetCurrent(GLSurface* surface) {
current_surface_.Pointer()->Set(surface);
} }
GLSurfaceAdapter::~GLSurfaceAdapter() { GLSurfaceAdapter::GLSurfaceAdapter(GLSurface* surface) : surface_(surface) {}
}
bool GLSurfaceAdapter::Initialize() { bool GLSurfaceAdapter::Initialize() {
return surface_->Initialize(); return surface_->Initialize();
...@@ -208,4 +203,6 @@ unsigned GLSurfaceAdapter::GetFormat() { ...@@ -208,4 +203,6 @@ unsigned GLSurfaceAdapter::GetFormat() {
return surface_->GetFormat(); return surface_->GetFormat();
} }
GLSurfaceAdapter::~GLSurfaceAdapter() {}
} // namespace gfx } // namespace gfx
...@@ -122,7 +122,6 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { ...@@ -122,7 +122,6 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
class GL_EXPORT GLSurfaceAdapter : public GLSurface { class GL_EXPORT GLSurfaceAdapter : public GLSurface {
public: public:
explicit GLSurfaceAdapter(GLSurface* surface); explicit GLSurfaceAdapter(GLSurface* surface);
virtual ~GLSurfaceAdapter();
virtual bool Initialize() OVERRIDE; virtual bool Initialize() OVERRIDE;
virtual void Destroy() OVERRIDE; virtual void Destroy() OVERRIDE;
...@@ -143,6 +142,9 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface { ...@@ -143,6 +142,9 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
GLSurface* surface() const { return surface_.get(); } GLSurface* surface() const { return surface_.get(); }
protected:
virtual ~GLSurfaceAdapter();
private: private:
scoped_refptr<GLSurface> surface_; scoped_refptr<GLSurface> surface_;
DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter);
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -19,11 +19,7 @@ namespace { ...@@ -19,11 +19,7 @@ namespace {
CGLPixelFormatObj g_pixel_format; CGLPixelFormatObj g_pixel_format;
} }
GLSurfaceCGL::GLSurfaceCGL() { GLSurfaceCGL::GLSurfaceCGL() {}
}
GLSurfaceCGL::~GLSurfaceCGL() {
}
bool GLSurfaceCGL::InitializeOneOff() { bool GLSurfaceCGL::InitializeOneOff() {
static bool initialized = false; static bool initialized = false;
...@@ -68,14 +64,12 @@ void* GLSurfaceCGL::GetPixelFormat() { ...@@ -68,14 +64,12 @@ void* GLSurfaceCGL::GetPixelFormat() {
return g_pixel_format; return g_pixel_format;
} }
GLSurfaceCGL::~GLSurfaceCGL() {}
NoOpGLSurfaceCGL::NoOpGLSurfaceCGL(const gfx::Size& size) NoOpGLSurfaceCGL::NoOpGLSurfaceCGL(const gfx::Size& size)
: size_(size) { : size_(size) {
} }
NoOpGLSurfaceCGL::~NoOpGLSurfaceCGL() {
Destroy();
}
bool NoOpGLSurfaceCGL::Initialize() { bool NoOpGLSurfaceCGL::Initialize() {
return true; return true;
} }
...@@ -100,4 +94,8 @@ void* NoOpGLSurfaceCGL::GetHandle() { ...@@ -100,4 +94,8 @@ void* NoOpGLSurfaceCGL::GetHandle() {
return NULL; return NULL;
} }
NoOpGLSurfaceCGL::~NoOpGLSurfaceCGL() {
Destroy();
}
} // namespace gfx } // namespace gfx
...@@ -14,11 +14,13 @@ namespace gfx { ...@@ -14,11 +14,13 @@ namespace gfx {
class GLSurfaceCGL : public GLSurface { class GLSurfaceCGL : public GLSurface {
public: public:
GLSurfaceCGL(); GLSurfaceCGL();
virtual ~GLSurfaceCGL();
static bool InitializeOneOff(); static bool InitializeOneOff();
static void* GetPixelFormat(); static void* GetPixelFormat();
protected:
virtual ~GLSurfaceCGL();
private: private:
DISALLOW_COPY_AND_ASSIGN(GLSurfaceCGL); DISALLOW_COPY_AND_ASSIGN(GLSurfaceCGL);
}; };
...@@ -30,7 +32,6 @@ class GLSurfaceCGL : public GLSurface { ...@@ -30,7 +32,6 @@ class GLSurfaceCGL : public GLSurface {
class UI_EXPORT NoOpGLSurfaceCGL : public GLSurfaceCGL { class UI_EXPORT NoOpGLSurfaceCGL : public GLSurfaceCGL {
public: public:
explicit NoOpGLSurfaceCGL(const gfx::Size& size); explicit NoOpGLSurfaceCGL(const gfx::Size& size);
virtual ~NoOpGLSurfaceCGL();
// Implement GLSurface. // Implement GLSurface.
virtual bool Initialize() OVERRIDE; virtual bool Initialize() OVERRIDE;
...@@ -40,6 +41,9 @@ class UI_EXPORT NoOpGLSurfaceCGL : public GLSurfaceCGL { ...@@ -40,6 +41,9 @@ class UI_EXPORT NoOpGLSurfaceCGL : public GLSurfaceCGL {
virtual gfx::Size GetSize() OVERRIDE; virtual gfx::Size GetSize() OVERRIDE;
virtual void* GetHandle() OVERRIDE; virtual void* GetHandle() OVERRIDE;
protected:
virtual ~NoOpGLSurfaceCGL();
private: private:
gfx::Size size_; gfx::Size size_;
......
...@@ -14,10 +14,6 @@ GLSurfaceOSMesa::GLSurfaceOSMesa(unsigned format, const gfx::Size& size) ...@@ -14,10 +14,6 @@ GLSurfaceOSMesa::GLSurfaceOSMesa(unsigned format, const gfx::Size& size)
size_(size) { size_(size) {
} }
GLSurfaceOSMesa::~GLSurfaceOSMesa() {
Destroy();
}
bool GLSurfaceOSMesa::Initialize() { bool GLSurfaceOSMesa::Initialize() {
return Resize(size_); return Resize(size_);
} }
...@@ -79,4 +75,8 @@ unsigned GLSurfaceOSMesa::GetFormat() { ...@@ -79,4 +75,8 @@ unsigned GLSurfaceOSMesa::GetFormat() {
return format_; return format_;
} }
GLSurfaceOSMesa::~GLSurfaceOSMesa() {
Destroy();
}
} // namespace gfx } // namespace gfx
...@@ -18,7 +18,6 @@ namespace gfx { ...@@ -18,7 +18,6 @@ namespace gfx {
class GL_EXPORT GLSurfaceOSMesa : public GLSurface { class GL_EXPORT GLSurfaceOSMesa : public GLSurface {
public: public:
GLSurfaceOSMesa(unsigned format, const gfx::Size& size); GLSurfaceOSMesa(unsigned format, const gfx::Size& size);
virtual ~GLSurfaceOSMesa();
// Implement GLSurface. // Implement GLSurface.
virtual bool Initialize() OVERRIDE; virtual bool Initialize() OVERRIDE;
...@@ -30,6 +29,9 @@ class GL_EXPORT GLSurfaceOSMesa : public GLSurface { ...@@ -30,6 +29,9 @@ class GL_EXPORT GLSurfaceOSMesa : public GLSurface {
virtual void* GetHandle() OVERRIDE; virtual void* GetHandle() OVERRIDE;
virtual unsigned GetFormat() OVERRIDE; virtual unsigned GetFormat() OVERRIDE;
protected:
virtual ~GLSurfaceOSMesa();
private: private:
unsigned format_; unsigned format_;
gfx::Size size_; gfx::Size size_;
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
namespace gfx { namespace gfx {
GLSurfaceStub::~GLSurfaceStub() {
}
void GLSurfaceStub::Destroy() { void GLSurfaceStub::Destroy() {
} }
...@@ -28,4 +25,6 @@ void* GLSurfaceStub::GetHandle() { ...@@ -28,4 +25,6 @@ void* GLSurfaceStub::GetHandle() {
return NULL; return NULL;
} }
GLSurfaceStub::~GLSurfaceStub() {}
} // namespace gfx } // namespace gfx
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -13,8 +13,6 @@ namespace gfx { ...@@ -13,8 +13,6 @@ namespace gfx {
// A GLSurface that does nothing for unit tests. // A GLSurface that does nothing for unit tests.
class GL_EXPORT GLSurfaceStub : public GLSurface { class GL_EXPORT GLSurfaceStub : public GLSurface {
public: public:
virtual ~GLSurfaceStub();
void SetSize(const gfx::Size& size) { size_ = size; } void SetSize(const gfx::Size& size) { size_ = size; }
// Implement GLSurface. // Implement GLSurface.
...@@ -24,6 +22,9 @@ class GL_EXPORT GLSurfaceStub : public GLSurface { ...@@ -24,6 +22,9 @@ class GL_EXPORT GLSurfaceStub : public GLSurface {
virtual gfx::Size GetSize() OVERRIDE; virtual gfx::Size GetSize() OVERRIDE;
virtual void* GetHandle() OVERRIDE; virtual void* GetHandle() OVERRIDE;
protected:
virtual ~GLSurfaceStub();
private: private:
gfx::Size size_; gfx::Size size_;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment