Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / loader / resource_message_delegate.h
blob934d60c0231d56188eb019e4dd2580ef446a5905
1 // 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.
5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_
6 #define CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_
8 #include "base/basictypes.h"
9 #include "content/common/content_export.h"
10 #include "content/public/browser/global_request_id.h"
12 namespace IPC {
13 class Message;
16 namespace net {
17 class URLRequest;
20 namespace content {
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.
25 class CONTENT_EXPORT ResourceMessageDelegate {
26 public:
27 ResourceMessageDelegate(const net::URLRequest* request);
28 virtual ~ResourceMessageDelegate();
30 // Called when the ResourceDispatcherHostImpl receives a message specifically
31 // for this delegate.
32 virtual bool OnMessageReceived(const IPC::Message& message) = 0;
34 void set_request_id(const GlobalRequestID& new_request_id) {
35 id_ = new_request_id;
38 private:
39 GlobalRequestID id_;
40 DISALLOW_IMPLICIT_CONSTRUCTORS(ResourceMessageDelegate);
43 } // namespace content
45 #endif // CONTENT_BROWSER_LOADER_RESOURCE_MESSAGE_DELEGATE_