blob: d707c44215593e9edd8e74e1f3fd3ec5898a6d5d [file] [log] [blame]
[email protected]0651b812011-02-24 00:22:501// Copyright (c) 2011 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#include "net/base/network_delegate.h"
6
7#include "base/logging.h"
8
9namespace net {
10
[email protected]4875ba12011-03-30 22:31:5111int NetworkDelegate::NotifyBeforeURLRequest(URLRequest* request,
[email protected]4c76d7c2011-04-15 19:14:1212 CompletionCallback* callback,
13 GURL* new_url) {
[email protected]0651b812011-02-24 00:22:5014 DCHECK(CalledOnValidThread());
15 DCHECK(request);
[email protected]05cc4e72011-03-08 21:29:4816 DCHECK(callback);
[email protected]4c76d7c2011-04-15 19:14:1217 return OnBeforeURLRequest(request, callback, new_url);
[email protected]0651b812011-02-24 00:22:5018}
19
[email protected]4875ba12011-03-30 22:31:5120int NetworkDelegate::NotifyBeforeSendHeaders(uint64 request_id,
[email protected]4c76d7c2011-04-15 19:14:1221 CompletionCallback* callback,
22 HttpRequestHeaders* headers) {
[email protected]0651b812011-02-24 00:22:5023 DCHECK(CalledOnValidThread());
24 DCHECK(headers);
[email protected]4875ba12011-03-30 22:31:5125 DCHECK(callback);
[email protected]4c76d7c2011-04-15 19:14:1226 return OnBeforeSendHeaders(request_id, callback, headers);
[email protected]0651b812011-02-24 00:22:5027}
28
29void NetworkDelegate::NotifyResponseStarted(URLRequest* request) {
30 DCHECK(CalledOnValidThread());
31 DCHECK(request);
32 OnResponseStarted(request);
33}
34
35void NetworkDelegate::NotifyReadCompleted(URLRequest* request, int bytes_read) {
36 DCHECK(CalledOnValidThread());
37 DCHECK(request);
38 OnReadCompleted(request, bytes_read);
39}
40
[email protected]4875ba12011-03-30 22:31:5141void NetworkDelegate::NotifyURLRequestDestroyed(URLRequest* request) {
42 DCHECK(request);
43 return OnURLRequestDestroyed(request);
44}
45
[email protected]4b50cb52011-03-10 00:29:3746URLRequestJob* NetworkDelegate::MaybeCreateURLRequestJob(URLRequest* request) {
47 DCHECK(CalledOnValidThread());
48 DCHECK(request);
49 return OnMaybeCreateURLRequestJob(request);
50}
51
[email protected]0651b812011-02-24 00:22:5052} // namespace net