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