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_ |