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 #include "content/browser/loader/resource_message_delegate.h"
7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 #include "content/browser/loader/resource_request_info_impl.h"
9 #include "net/url_request/url_request.h"
13 ResourceMessageDelegate::ResourceMessageDelegate(const net::URLRequest
* request
)
14 : id_(ResourceRequestInfoImpl::ForRequest(request
)->GetGlobalRequestID()) {
15 ResourceDispatcherHostImpl
* rdh
= ResourceDispatcherHostImpl::Get();
16 rdh
->RegisterResourceMessageDelegate(id_
, this);
19 ResourceMessageDelegate::~ResourceMessageDelegate() {
20 ResourceDispatcherHostImpl
* rdh
= ResourceDispatcherHostImpl::Get();
21 rdh
->UnregisterResourceMessageDelegate(id_
, this);
24 } // namespace content