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

Unified Diff: net/spdy/push_delegate.h

Issue 2458793002: Server push cancellation: add PushPromiseHelper which reflects information on the push promise. (Closed)
Patch Set: add PushDelegate Created 4 years, 2 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
Index: net/spdy/push_delegate.h
diff --git a/net/spdy/push_delegate.h b/net/spdy/push_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..b980357bc043da33d41ff9bdc0186b2b476fc18c
--- /dev/null
+++ b/net/spdy/push_delegate.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2016 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 NET_SPDY_PUSH_DELEGATE_H_
+#define NET_SPDY_PUSH_DELEGATE_H_
+
+#include "net/base/net_export.h"
+#include "url/gurl.h"
+
+namespace net {
+
+// An interface to a class that reflects information on the pushed request.
+class NET_EXPORT PushPromiseHelper {
Ryan Hamilton 2016/10/28 00:32:22 This class exists to be used by the delegate, righ
Zhongyi Shi 2016/11/07 22:07:03 Done.
+ public:
+ virtual ~PushPromiseHelper() {}
+
+ // Cancels the push if it is not claimed yet.
+ virtual void Cancel() = 0;
+
+ // Gets the URL of the pushed request.
+ virtual const GURL& GetURL() = 0;
+};
+
+class NET_EXPORT PushDelegate {
+ public:
+ virtual ~PushDelegate() {}
+
+ // Invoked by session when a push promise has been received.
+ virtual void OnPush(std::unique_ptr<PushPromiseHelper> push_promise) = 0;
Ryan Hamilton 2016/10/28 00:32:22 Instead of putting the URL into the Helper and the
Zhongyi Shi 2016/11/07 22:07:03 There would be only one implementation of PushDele
Ryan Hamilton 2016/11/08 22:27:01 But both places OnPush() is called, the URL is sit
+};
+
+} // namespace net
+
+#endif // NET_SPDY_PUSH_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698