Add ONC 'Source' configuration property
[chromium-blink-merge.git] / net / disk_cache / net_log_parameters.h
blob3598cda7b12b3e143745cc0f1ed92afed6841f2b
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_
8 #include <string>
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 {
16 class Entry;
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
21 // callback.
22 net::NetLog::ParametersCallback CreateNetLogEntryCreationCallback(
23 const Entry* entry,
24 bool created);
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(
29 int index,
30 int offset,
31 int buf_len,
32 bool truncate);
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(
40 int bytes_copied);
42 // Creates a NetLog callback that returns parameters for when a sparse
43 // operation is started.
44 net::NetLog::ParametersCallback CreateNetLogSparseOperationCallback(
45 int64 offset,
46 int buff_len);
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,
52 int child_len);
54 // Creates a NetLog callback that returns parameters for when a call to
55 // GetAvailableRange returns.
56 net::NetLog::ParametersCallback CreateNetLogGetAvailableRangeResultCallback(
57 int64 start,
58 int result);
60 } // namespace disk_cache
62 #endif // NET_DISK_CACHE_NET_LOG_CACHE_PARAMETERS_H_