blob: ed2d4f2351bc2c35c84abeb1dc3cabb5fbd8a341 [file] [log] [blame]
zhongyi7465c1b2016-11-11 01:38:051// 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
Bence Béky94658bf2018-05-11 19:22:585#ifndef NET_SPDY_SERVER_PUSH_DELEGATE_H_
6#define NET_SPDY_SERVER_PUSH_DELEGATE_H_
bnc2da0f0142017-05-12 20:08:057
8#include <memory>
zhongyi7465c1b2016-11-11 01:38:059
10#include "net/base/net_export.h"
zhongyid2a4cae2017-02-11 10:54:3811#include "net/log/net_log_with_source.h"
zhongyi7465c1b2016-11-11 01:38:0512#include "url/gurl.h"
13
14namespace net {
15
16// An interface to a class that should be notified when session receives server
17// push.
18class NET_EXPORT_PRIVATE ServerPushDelegate {
19 public:
20 // An interface to a class that reflects information on the pushed request.
21 class NET_EXPORT ServerPushHelper {
22 public:
23 virtual ~ServerPushHelper() {}
24
25 // Cancels the push if it is not claimed yet.
26 virtual void Cancel() = 0;
27
28 // Gets the URL of the pushed request.
zhongyid2a4cae2017-02-11 10:54:3829 virtual const GURL& GetURL() const = 0;
zhongyi7465c1b2016-11-11 01:38:0530 };
31
32 virtual ~ServerPushDelegate() {}
33
34 // Invoked by session when a push promise has been received.
zhongyid2a4cae2017-02-11 10:54:3835 virtual void OnPush(std::unique_ptr<ServerPushHelper> push_helper,
36 const NetLogWithSource& session_net_log) = 0;
zhongyi7465c1b2016-11-11 01:38:0537};
38
39} // namespace net
40
Bence Béky94658bf2018-05-11 19:22:5841#endif // NET_SPDY_SERVER_PUSH_DELEGATE_H_