Bug 1261340: Don't refer to |ScopedFreePtrTraits| in |RawDBusConnection|, r=shuang

The class template |ScopedFreePtrTrais| has been removed. This patch
updates |RawDBusConnection| to not refer to it any longer. Instead, the
provided helper method |empty| is implemented directly.
This commit is contained in:
Thomas Zimmermann 2016-04-08 10:07:28 +02:00
Родитель 24f0f28af4
Коммит 4bc7ae6624
2 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -4,7 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <dbus/dbus.h>
#include "base/message_loop.h"
#include "nsThreadUtils.h"
#include "RawDBusConnection.h"
@ -274,6 +273,11 @@ bool RawDBusConnection::Watch()
return true;
}
DBusConnection* RawDBusConnection::ScopedDBusConnectionPtrTraits::empty()
{
return nullptr;
}
void RawDBusConnection::ScopedDBusConnectionPtrTraits::release(DBusConnection* ptr)
{
if (ptr) {

Просмотреть файл

@ -7,11 +7,9 @@
#ifndef mozilla_ipc_dbus_gonk_rawdbusconnection_h__
#define mozilla_ipc_dbus_gonk_rawdbusconnection_h__
#include <dbus/dbus.h>
#include "mozilla/Scoped.h"
struct DBusConnection;
struct DBusMessage;
namespace mozilla {
namespace ipc {
@ -19,8 +17,11 @@ typedef void (*DBusReplyCallback)(DBusMessage*, void*);
class RawDBusConnection
{
struct ScopedDBusConnectionPtrTraits : ScopedFreePtrTraits<DBusConnection>
struct ScopedDBusConnectionPtrTraits
{
typedef DBusConnection* type;
static DBusConnection* empty();
static void release(DBusConnection* ptr);
};