OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_SPDY_SERVER_PUSH_DELEGATE_H_ |
| 6 #define NET_SPDY_SERVER_PUSH_DELEGATE_H_ |
| 7 |
| 8 #include "net/base/net_export.h" |
| 9 #include "url/gurl.h" |
| 10 |
| 11 namespace net { |
| 12 |
| 13 // An interface to a class that should be notified when session receives server |
| 14 // push. |
| 15 class NET_EXPORT_PRIVATE ServerPushDelegate { |
| 16 public: |
| 17 // An interface to a class that reflects information on the pushed request. |
| 18 class NET_EXPORT ServerPushHelper { |
| 19 public: |
| 20 virtual ~ServerPushHelper() {} |
| 21 |
| 22 // Cancels the push if it is not claimed yet. |
| 23 virtual void Cancel() = 0; |
| 24 |
| 25 // Gets the URL of the pushed request. |
| 26 virtual const GURL& GetURL() = 0; |
| 27 }; |
| 28 |
| 29 virtual ~ServerPushDelegate() {} |
| 30 |
| 31 // Invoked by session when a push promise has been received. |
| 32 virtual void OnPush(std::unique_ptr<ServerPushHelper> push_helper) = 0; |
| 33 }; |
| 34 |
| 35 } // namespace net |
| 36 |
| 37 #endif // NET_SPDY_PUSH_DELEGATE_H_ |
OLD | NEW |