blob: bb176c1302559211b92252e0202b931fa548d60e [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
[email protected]82b42302011-04-20 16:28:1629void NetworkDelegate::NotifyRequestSent(
30 uint64 request_id,
31 const HostPortPair& socket_address) {
32 DCHECK(CalledOnValidThread());
33 OnRequestSent(request_id, socket_address);
34}
35
[email protected]0651b812011-02-24 00:22:5036void NetworkDelegate::NotifyResponseStarted(URLRequest* request) {
37 DCHECK(CalledOnValidThread());
38 DCHECK(request);
39 OnResponseStarted(request);
40}
41
[email protected]31b2e5f2011-04-20 16:58:3242void NetworkDelegate::NotifyBeforeRedirect(URLRequest* request,
43 const GURL& new_location) {
44 DCHECK(CalledOnValidThread());
45 DCHECK(request);
46 OnBeforeRedirect(request, new_location);
47}
48
49
[email protected]0651b812011-02-24 00:22:5050void NetworkDelegate::NotifyReadCompleted(URLRequest* request, int bytes_read) {
51 DCHECK(CalledOnValidThread());
52 DCHECK(request);
53 OnReadCompleted(request, bytes_read);
54}
55
[email protected]4875ba12011-03-30 22:31:5156void NetworkDelegate::NotifyURLRequestDestroyed(URLRequest* request) {
57 DCHECK(request);
58 return OnURLRequestDestroyed(request);
59}
60
[email protected]4b50cb52011-03-10 00:29:3761URLRequestJob* NetworkDelegate::MaybeCreateURLRequestJob(URLRequest* request) {
62 DCHECK(CalledOnValidThread());
63 DCHECK(request);
64 return OnMaybeCreateURLRequestJob(request);
65}
66
[email protected]0651b812011-02-24 00:22:5067} // namespace net