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

Unified Diff: Source/modules/push_messaging/PushPermissionRequestCallback.h

Issue 707833002: Plumb Push API permission request through Blink using Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comments on ownership in PushPermissionRequestCallback. Created 6 years, 1 month 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
Index: Source/modules/push_messaging/PushPermissionRequestCallback.h
diff --git a/Source/modules/push_messaging/PushPermissionRequestCallback.h b/Source/modules/push_messaging/PushPermissionRequestCallback.h
new file mode 100644
index 0000000000000000000000000000000000000000..8c82a53f26d398cd401a099c6ca2b682642022f2
--- /dev/null
+++ b/Source/modules/push_messaging/PushPermissionRequestCallback.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PushPermissionRequestCallback_h
+#define PushPermissionRequestCallback_h
+
+#include "platform/heap/Handle.h"
+#include "public/platform/WebCallback.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+
+class PushManager;
+class ScriptPromiseResolver;
+class WebPushClient;
+class WebServiceWorkerProvider;
+
+class PushPermissionRequestCallback final : public WebCallback {
+ WTF_MAKE_NONCOPYABLE(PushPermissionRequestCallback);
+
+public:
+ // Since |PushManager| is oilpan garbage collected this will keep it alive.
+ // Does not take ownership of |WebPushClient|.
+ // Since |ScriptPromiseResolver| is ref counted this will keep it alive.
+ // Does not take ownership of |WebServiceWorkerProvider|.
+ PushPermissionRequestCallback(PushManager*, WebPushClient*, PassRefPtr<ScriptPromiseResolver>, WebServiceWorkerProvider*);
+ ~PushPermissionRequestCallback() override;
+
+ void run() override;
+
+private:
+ Persistent<PushManager> m_manager;
+ WebPushClient* m_client;
+ RefPtr<ScriptPromiseResolver> m_resolver;
+ WebServiceWorkerProvider* m_serviceWorkerProvider;
+};
+
+} // namespace blink
+
+#endif // PushPermissionRequestCallback_h

Powered by Google App Engine
This is Rietveld 408576698