blob: f007f1ca356eec77445b2c4a5e33a8d16868ef09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_H_
#define CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_H_
#include "base/macros.h"
#include "content/common/content_export.h"
#include "content/public/browser/global_request_id.h"
namespace IPC {
class Message;
}
namespace net {
class URLRequest;
}
namespace content {
// A ResourceMessageDelegate receives IPC ResourceMsg_* messages for a specified
// URLRequest. The delegate should implement its own IPC handler. It will
// receive the message _after_ the ResourceDispatcherHost has handled it.
class CONTENT_EXPORT ResourceMessageDelegate {
public:
ResourceMessageDelegate(const net::URLRequest* request);
virtual ~ResourceMessageDelegate();
// Called when the ResourceDispatcherHostImpl receives a message specifically
// for this delegate.
virtual bool OnMessageReceived(const IPC::Message& message) = 0;
void set_request_id(const GlobalRequestID& new_request_id) {
id_ = new_request_id;
}
private:
GlobalRequestID id_;
DISALLOW_IMPLICIT_CONSTRUCTORS(ResourceMessageDelegate);
};
} // namespace content
#endif // CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_H_
|