blob: 28d0b318702c8444be751c194603f2b81473d3f3 [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]636eccd2011-06-28 12:28:0120int NetworkDelegate::NotifyBeforeSendHeaders(URLRequest* request,
[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]636eccd2011-06-28 12:28:0126 return OnBeforeSendHeaders(request, callback, headers);
[email protected]0651b812011-02-24 00:22:5027}
28
[email protected]5796dc942011-07-14 19:26:1029void NetworkDelegate::NotifySendHeaders(URLRequest* request,
30 const HttpRequestHeaders& headers) {
[email protected]82b42302011-04-20 16:28:1631 DCHECK(CalledOnValidThread());
[email protected]5796dc942011-07-14 19:26:1032 OnSendHeaders(request, headers);
[email protected]82b42302011-04-20 16:28:1633}
34
[email protected]0651b812011-02-24 00:22:5035void NetworkDelegate::NotifyResponseStarted(URLRequest* request) {
36 DCHECK(CalledOnValidThread());
37 DCHECK(request);
38 OnResponseStarted(request);
39}
40
[email protected]8523ba52011-05-22 19:00:5841void NetworkDelegate::NotifyRawBytesRead(const URLRequest& request,
42 int bytes_read) {
43 DCHECK(CalledOnValidThread());
44 OnRawBytesRead(request, bytes_read);
45}
46
[email protected]31b2e5f2011-04-20 16:58:3247void NetworkDelegate::NotifyBeforeRedirect(URLRequest* request,
48 const GURL& new_location) {
49 DCHECK(CalledOnValidThread());
50 DCHECK(request);
51 OnBeforeRedirect(request, new_location);
52}
53
[email protected]48944382011-04-23 13:28:1654void NetworkDelegate::NotifyCompleted(URLRequest* request) {
[email protected]0651b812011-02-24 00:22:5055 DCHECK(CalledOnValidThread());
56 DCHECK(request);
[email protected]48944382011-04-23 13:28:1657 OnCompleted(request);
[email protected]0651b812011-02-24 00:22:5058}
59
[email protected]4875ba12011-03-30 22:31:5160void NetworkDelegate::NotifyURLRequestDestroyed(URLRequest* request) {
[email protected]5aa20132011-04-27 23:11:3461 DCHECK(CalledOnValidThread());
[email protected]4875ba12011-03-30 22:31:5162 DCHECK(request);
[email protected]5aa20132011-04-27 23:11:3463 OnURLRequestDestroyed(request);
64}
65
[email protected]82a37672011-05-03 12:02:4166void NetworkDelegate::NotifyPACScriptError(int line_number,
67 const string16& error) {
68 DCHECK(CalledOnValidThread());
69 OnPACScriptError(line_number, error);
70}
71
[email protected]7efc582d2011-08-03 20:46:3572void NetworkDelegate::NotifyAuthRequired(URLRequest* request,
73 const AuthChallengeInfo& auth_info) {
74 DCHECK(CalledOnValidThread());
75 OnAuthRequired(request, auth_info);
76}
77
[email protected]0651b812011-02-24 00:22:5078} // namespace net