blob: 2a5dc45ebc477b8c973c279d26d9e8ac4a2b7cc9 [file] [log] [blame]
[email protected]a17df45d2013-02-15 11:12:461// Copyright (c) 2013 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
tfarinabccc34c72015-02-27 21:32:155#ifndef CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_H_
6#define CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_H_
[email protected]a17df45d2013-02-15 11:12:467
8#include "base/basictypes.h"
9#include "content/common/content_export.h"
10#include "content/public/browser/global_request_id.h"
11
12namespace IPC {
13class Message;
14}
15
16namespace net {
17class URLRequest;
18}
19
20namespace content {
21
22// A ResourceMessageDelegate receives IPC ResourceMsg_* messages for a specified
23// URLRequest. The delegate should implement its own IPC handler. It will
24// receive the message _after_ the ResourceDispatcherHost has handled it.
25class CONTENT_EXPORT ResourceMessageDelegate {
26 public:
27 ResourceMessageDelegate(const net::URLRequest* request);
28 virtual ~ResourceMessageDelegate();
29
30 // Called when the ResourceDispatcherHostImpl receives a message specifically
31 // for this delegate.
[email protected]e44d1342014-05-16 21:29:3332 virtual bool OnMessageReceived(const IPC::Message& message) = 0;
[email protected]a17df45d2013-02-15 11:12:4633
[email protected]1f291cd2013-09-25 22:05:1434 void set_request_id(const GlobalRequestID& new_request_id) {
35 id_ = new_request_id;
36 }
37
[email protected]a17df45d2013-02-15 11:12:4638 private:
39 GlobalRequestID id_;
40 DISALLOW_IMPLICIT_CONSTRUCTORS(ResourceMessageDelegate);
41};
42
43} // namespace content
44
tfarinabccc34c72015-02-27 21:32:1545#endif // CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_H_