1// 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 11int NetworkDelegate::NotifyBeforeURLRequest(URLRequest* request, 12 CompletionCallback* callback, 13 GURL* new_url) { 14 DCHECK(CalledOnValidThread()); 15 DCHECK(request); 16 DCHECK(callback); 17 return OnBeforeURLRequest(request, callback, new_url); 18} 19 20int NetworkDelegate::NotifyBeforeSendHeaders(uint64 request_id, 21 CompletionCallback* callback, 22 HttpRequestHeaders* headers) { 23 DCHECK(CalledOnValidThread()); 24 DCHECK(headers); 25 DCHECK(callback); 26 return OnBeforeSendHeaders(request_id, callback, headers); 27} 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 41void NetworkDelegate::NotifyURLRequestDestroyed(URLRequest* request) { 42 DCHECK(request); 43 return OnURLRequestDestroyed(request); 44} 45 46URLRequestJob* NetworkDelegate::MaybeCreateURLRequestJob(URLRequest* request) { 47 DCHECK(CalledOnValidThread()); 48 DCHECK(request); 49 return OnMaybeCreateURLRequestJob(request); 50} 51 52} // namespace net 53