OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/disk_cache/simple/simple_entry_operation.h" | 5 #include "net/disk_cache/simple/simple_entry_operation.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
9 #include "net/disk_cache/disk_cache.h" | 9 #include "net/disk_cache/disk_cache.h" |
10 #include "net/disk_cache/simple/simple_entry_impl.h" | 10 #include "net/disk_cache/simple/simple_entry_impl.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 bool IsReadType(unsigned type) { | 23 bool IsReadType(unsigned type) { |
24 return type == SimpleEntryOperation::TYPE_READ || | 24 return type == SimpleEntryOperation::TYPE_READ || |
25 type == SimpleEntryOperation::TYPE_READ_SPARSE; | 25 type == SimpleEntryOperation::TYPE_READ_SPARSE; |
26 } | 26 } |
27 | 27 |
28 bool IsSparseType(unsigned type) { | 28 bool IsSparseType(unsigned type) { |
29 return type == SimpleEntryOperation::TYPE_READ_SPARSE || | 29 return type == SimpleEntryOperation::TYPE_READ_SPARSE || |
30 type == SimpleEntryOperation::TYPE_WRITE_SPARSE; | 30 type == SimpleEntryOperation::TYPE_WRITE_SPARSE; |
31 } | 31 } |
32 | |
33 } | 32 } |
34 | 33 |
35 SimpleEntryOperation::SimpleEntryOperation(const SimpleEntryOperation& other) | 34 SimpleEntryOperation::SimpleEntryOperation(const SimpleEntryOperation& other) |
36 : entry_(other.entry_.get()), | 35 : entry_(other.entry_.get()), |
37 buf_(other.buf_), | 36 buf_(other.buf_), |
38 callback_(other.callback_), | 37 callback_(other.callback_), |
39 out_entry_(other.out_entry_), | 38 out_entry_(other.out_entry_), |
40 offset_(other.offset_), | 39 offset_(other.offset_), |
41 sparse_offset_(other.sparse_offset_), | 40 sparse_offset_(other.sparse_offset_), |
42 length_(other.length_), | 41 length_(other.length_), |
43 out_start_(other.out_start_), | 42 out_start_(other.out_start_), |
44 type_(other.type_), | 43 type_(other.type_), |
45 have_index_(other.have_index_), | 44 have_index_(other.have_index_), |
46 index_(other.index_), | 45 index_(other.index_), |
47 truncate_(other.truncate_), | 46 truncate_(other.truncate_), |
48 optimistic_(other.optimistic_), | 47 optimistic_(other.optimistic_), |
49 alone_in_queue_(other.alone_in_queue_) { | 48 alone_in_queue_(other.alone_in_queue_) { |
50 } | 49 } |
51 | 50 |
52 SimpleEntryOperation::~SimpleEntryOperation() {} | 51 SimpleEntryOperation::~SimpleEntryOperation() { |
| 52 } |
53 | 53 |
54 // static | 54 // static |
55 SimpleEntryOperation SimpleEntryOperation::OpenOperation( | 55 SimpleEntryOperation SimpleEntryOperation::OpenOperation( |
56 SimpleEntryImpl* entry, | 56 SimpleEntryImpl* entry, |
57 bool have_index, | 57 bool have_index, |
58 const CompletionCallback& callback, | 58 const CompletionCallback& callback, |
59 Entry** out_entry) { | 59 Entry** out_entry) { |
60 return SimpleEntryOperation(entry, | 60 return SimpleEntryOperation(entry, |
61 NULL, | 61 NULL, |
62 callback, | 62 callback, |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 out_start_(out_start), | 331 out_start_(out_start), |
332 type_(type), | 332 type_(type), |
333 have_index_(have_index), | 333 have_index_(have_index), |
334 index_(index), | 334 index_(index), |
335 truncate_(truncate), | 335 truncate_(truncate), |
336 optimistic_(optimistic), | 336 optimistic_(optimistic), |
337 alone_in_queue_(alone_in_queue) { | 337 alone_in_queue_(alone_in_queue) { |
338 } | 338 } |
339 | 339 |
340 } // namespace disk_cache | 340 } // namespace disk_cache |
OLD | NEW |