1 // Copyright (c) 2012 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 #ifndef NET_DISK_CACHE_NET_LOG_PARAMETERS_H_
6 #define NET_DISK_CACHE_NET_LOG_PARAMETERS_H_
10 #include "net/base/net_log.h"
12 // This file contains a set of functions to create NetLog::ParametersCallbacks
13 // shared by EntryImpls and MemEntryImpls.
14 namespace disk_cache
{
18 // Creates a NetLog callback that returns parameters for the creation of an
19 // Entry. Contains the Entry's key and whether it was created or opened.
20 // |entry| can't be NULL, must support GetKey(), and must outlive the returned
22 net::NetLog::ParametersCallback
CreateNetLogEntryCreationCallback(
26 // Creates a NetLog callback that returns parameters for start of a non-sparse
27 // read or write of an Entry. For reads, |truncate| must be false.
28 net::NetLog::ParametersCallback
CreateNetLogReadWriteDataCallback(
34 // Creates a NetLog callback that returns parameters for when a non-sparse
35 // read or write completes. For reads, |truncate| must be false.
36 // |bytes_copied| is either the number of bytes copied or a network error
37 // code. |bytes_copied| must not be ERR_IO_PENDING, as it's not a valid
38 // result for an operation.
39 net::NetLog::ParametersCallback
CreateNetLogReadWriteCompleteCallback(
42 // Creates a NetLog callback that returns parameters for when a sparse
43 // operation is started.
44 net::NetLog::ParametersCallback
CreateNetLogSparseOperationCallback(
48 // Creates a NetLog callback that returns parameters for when a read or write
49 // for a sparse entry's child is started.
50 net::NetLog::ParametersCallback
CreateNetLogSparseReadWriteCallback(
51 const net::NetLog::Source
& source
,
54 // Creates a NetLog callback that returns parameters for when a call to
55 // GetAvailableRange returns.
56 net::NetLog::ParametersCallback
CreateNetLogGetAvailableRangeResultCallback(
60 } // namespace disk_cache
62 #endif // NET_DISK_CACHE_NET_LOG_CACHE_PARAMETERS_H_