| 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 "net/log/net_log_with_source.h" | |
| 10 #include "url/gurl.h" | |
| 11 | |
| 12 namespace net { | |
| 13 | |
| 14 // An interface to a class that should be notified when session receives server | |
| 15 // push. | |
| 16 class NET_EXPORT_PRIVATE ServerPushDelegate { | |
| 17 public: | |
| 18 // An interface to a class that reflects information on the pushed request. | |
| 19 class NET_EXPORT ServerPushHelper { | |
| 20 public: | |
| 21 virtual ~ServerPushHelper() {} | |
| 22 | |
| 23 // Cancels the push if it is not claimed yet. | |
| 24 virtual void Cancel() = 0; | |
| 25 | |
| 26 // Gets the URL of the pushed request. | |
| 27 virtual const GURL& GetURL() const = 0; | |
| 28 }; | |
| 29 | |
| 30 virtual ~ServerPushDelegate() {} | |
| 31 | |
| 32 // Invoked by session when a push promise has been received. | |
| 33 virtual void OnPush(std::unique_ptr<ServerPushHelper> push_helper, | |
| 34 const NetLogWithSource& session_net_log) = 0; | |
| 35 }; | |
| 36 | |
| 37 } // namespace net | |
| 38 | |
| 39 #endif // NET_SPDY_SERVER_PUSH_DELEGATE_H_ | |
| OLD | NEW |