resource_controller.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_RESOURCE_CONTROLLER_H_
6#define CONTENT_PUBLIC_BROWSER_RESOURCE_CONTROLLER_H_
7
8namespace content {
9
10// Used to either resume a deferred resource load or cancel a resource load at
11// any time.  CancelAndIgnore is a variation of Cancel that also causes the
12// requester of the resource to act like the request was never made.  By
13// default, load is cancelled with ERR_ABORTED code. CancelWithError can be used
14// to cancel load with any other error code.
15class ResourceController {
16 public:
17  virtual void Cancel() = 0;
18  virtual void CancelAndIgnore() = 0;
19  virtual void CancelWithError(int error_code) = 0;
20  virtual void Resume() = 0;
21 protected:
22  virtual ~ResourceController() {}
23};
24
25}  // namespace content
26
27#endif  // CONTENT_PUBLIC_BROWSER_RESOURCE_CONTROLLER_H_
28