| Index: chrome/browser/notifications/notification_platform_bridge_linux.h
|
| diff --git a/chrome/browser/notifications/notification_platform_bridge_linux.h b/chrome/browser/notifications/notification_platform_bridge_linux.h
|
| index af0b9ee3629f1967a4fd32e24ccf7598a2391ca0..c9024c24e6083fdf68873d41c0c956013cdf2a60 100644
|
| --- a/chrome/browser/notifications/notification_platform_bridge_linux.h
|
| +++ b/chrome/browser/notifications/notification_platform_bridge_linux.h
|
| @@ -10,6 +10,7 @@
|
| #include <unordered_map>
|
|
|
| #include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "chrome/browser/notifications/notification_platform_bridge.h"
|
| #include "ui/base/glib/glib_signal.h"
|
| #include "ui/base/glib/scoped_gobject.h"
|
| @@ -38,27 +39,21 @@ class NotificationPlatformBridgeLinux : public NotificationPlatformBridge {
|
|
|
| private:
|
| struct NotificationData;
|
| -
|
| - ScopedGObject<GDBusProxy> notification_proxy_;
|
| -
|
| - // Used to disconnect from "g-signal" during destruction.
|
| - gulong proxy_signal_handler_ = 0;
|
| -
|
| - // A std::set<std::unique_ptr<T>> doesn't work well because
|
| - // eg. std::set::erase(T) would require a std::unique_ptr<T>
|
| - // argument, so the data would get double-destructed.
|
| - template <typename T>
|
| - using UnorderedUniqueSet = std::unordered_map<T*, std::unique_ptr<T>>;
|
| -
|
| - UnorderedUniqueSet<NotificationData> notifications_;
|
| + struct ResourceFiles;
|
| +
|
| + // Sets up a task to call NotifyNow() after an IO thread writes the
|
| + // necessary resource files.
|
| + void Notify(const Notification& notification,
|
| + NotificationData* data,
|
| + GAsyncReadyCallback callback,
|
| + gpointer user_data);
|
|
|
| // Makes the "Notify" call to D-Bus.
|
| - void NotifyNow(uint32_t dbus_id,
|
| - NotificationCommon::Type notification_type,
|
| - const Notification& notification,
|
| - GCancellable* cancellable,
|
| + void NotifyNow(const Notification& notification,
|
| + base::WeakPtr<NotificationData> data,
|
| GAsyncReadyCallback callback,
|
| - gpointer user_data);
|
| + gpointer user_data,
|
| + std::unique_ptr<ResourceFiles> resource_files);
|
|
|
| // Makes the "CloseNotification" call to D-Bus.
|
| void CloseNow(uint32_t dbus_id);
|
| @@ -83,6 +78,21 @@ class NotificationPlatformBridgeLinux : public NotificationPlatformBridge {
|
|
|
| NotificationData* FindNotificationData(uint32_t dbus_id);
|
|
|
| + ScopedGObject<GDBusProxy> notification_proxy_;
|
| +
|
| + // Used to disconnect from "g-signal" during destruction.
|
| + gulong proxy_signal_handler_ = 0;
|
| +
|
| + // A std::set<std::unique_ptr<T>> doesn't work well because
|
| + // eg. std::set::erase(T) would require a std::unique_ptr<T>
|
| + // argument, so the data would get double-destructed.
|
| + template <typename T>
|
| + using UnorderedUniqueSet = std::unordered_map<T*, std::unique_ptr<T>>;
|
| +
|
| + UnorderedUniqueSet<NotificationData> notifications_;
|
| +
|
| + base::WeakPtrFactory<NotificationPlatformBridgeLinux> weak_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeLinux);
|
| };
|
|
|
|
|