summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-18 20:21:31 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-18 20:21:31 +0000
commitb104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17 (patch)
tree0d35c3f624aec7c6de8824fab2b9521bfff1dbff /net/disk_cache
parentd13509f32546e26332733ac6153d359fbd566eaa (diff)
downloadchromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.zip
chromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.tar.gz
chromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.tar.bz2
FBTF: Monster ctor patch after changing heuristics in clang plugin.
(Only 916k this time off Debug Linux .a files) BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3814013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/disk_format.cc21
-rw-r--r--net/disk_cache/disk_format.h14
-rw-r--r--net/disk_cache/file.cc16
-rw-r--r--net/disk_cache/file.h4
-rw-r--r--net/disk_cache/mem_backend_impl.cc2
-rw-r--r--net/disk_cache/mem_backend_impl.h2
-rw-r--r--net/disk_cache/sparse_control.cc11
-rw-r--r--net/disk_cache/sparse_control.h7
8 files changed, 58 insertions, 19 deletions
diff --git a/net/disk_cache/disk_format.cc b/net/disk_cache/disk_format.cc
new file mode 100644
index 0000000..5216b50
--- /dev/null
+++ b/net/disk_cache/disk_format.cc
@@ -0,0 +1,21 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/disk_cache/disk_format.h"
+
+namespace disk_cache {
+
+IndexHeader::IndexHeader() {
+ memset(this, 0, sizeof(*this));
+ magic = kIndexMagic;
+ version = kCurrentVersion;
+}
+
+BlockFileHeader::BlockFileHeader() {
+ memset(this, 0, sizeof(BlockFileHeader));
+ magic = kBlockMagic;
+ version = kCurrentVersion;
+}
+
+} // namespace disk_cache
diff --git a/net/disk_cache/disk_format.h b/net/disk_cache/disk_format.h
index ac4c6348..ffe36ae 100644
--- a/net/disk_cache/disk_format.h
+++ b/net/disk_cache/disk_format.h
@@ -80,6 +80,8 @@ struct LruData {
// Header for the master index file.
struct IndexHeader {
+ IndexHeader();
+
uint32 magic;
uint32 version;
int32 num_entries; // Number of entries currently stored.
@@ -93,11 +95,6 @@ struct IndexHeader {
uint64 create_time; // Creation time for this set of files.
int32 pad[52];
LruData lru; // Eviction control data.
- IndexHeader() {
- memset(this, 0, sizeof(*this));
- magic = kIndexMagic;
- version = kCurrentVersion;
- };
};
// The structure of the whole index file.
@@ -177,6 +174,8 @@ typedef uint32 AllocBitmap[kMaxBlocks / 32];
// from the beginning every time).
// This Structure is the header of a block-file:
struct BlockFileHeader {
+ BlockFileHeader();
+
uint32 magic;
uint32 version;
int16 this_file; // Index of this file.
@@ -189,11 +188,6 @@ struct BlockFileHeader {
volatile int32 updating; // Keep track of updates to the header.
int32 user[5];
AllocBitmap allocation_map;
- BlockFileHeader() {
- memset(this, 0, sizeof(BlockFileHeader));
- magic = kBlockMagic;
- version = kCurrentVersion;
- };
};
COMPILE_ASSERT(sizeof(BlockFileHeader) == kBlockHeaderSize, bad_header);
diff --git a/net/disk_cache/file.cc b/net/disk_cache/file.cc
new file mode 100644
index 0000000..6b56951
--- /dev/null
+++ b/net/disk_cache/file.cc
@@ -0,0 +1,16 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/disk_cache/file.h"
+
+namespace disk_cache {
+
+// Cross platform constructors. Platform specific code is in
+// file_{win,posix}.cc.
+
+File::File() : init_(false), mixed_(false) {}
+
+File::File(bool mixed_mode) : init_(false), mixed_(mixed_mode) {}
+
+} // namespace disk_cache
diff --git a/net/disk_cache/file.h b/net/disk_cache/file.h
index 43ba5c1..c266311 100644
--- a/net/disk_cache/file.h
+++ b/net/disk_cache/file.h
@@ -29,9 +29,9 @@ class FileIOCallback {
class File : public base::RefCounted<File> {
friend class base::RefCounted<File>;
public:
- File() : init_(false), mixed_(false) {}
+ File();
// mixed_mode set to true enables regular synchronous operations for the file.
- explicit File(bool mixed_mode) : init_(false), mixed_(mixed_mode) {}
+ explicit File(bool mixed_mode);
// Initializes the object to use the passed in file instead of opening it with
// the Init() call. No asynchronous operations can be performed with this
diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc
index fe57d7d..288a66e 100644
--- a/net/disk_cache/mem_backend_impl.cc
+++ b/net/disk_cache/mem_backend_impl.cc
@@ -62,6 +62,8 @@ bool MemBackendImpl::Init() {
return true;
}
+MemBackendImpl::MemBackendImpl() : max_size_(0), current_size_(0) {}
+
MemBackendImpl::~MemBackendImpl() {
EntryMap::iterator it = entries_.begin();
while (it != entries_.end()) {
diff --git a/net/disk_cache/mem_backend_impl.h b/net/disk_cache/mem_backend_impl.h
index 62ed3c5..c78c670 100644
--- a/net/disk_cache/mem_backend_impl.h
+++ b/net/disk_cache/mem_backend_impl.h
@@ -21,7 +21,7 @@ class MemEntryImpl;
// the operations of the cache without writing to disk.
class MemBackendImpl : public Backend {
public:
- MemBackendImpl() : max_size_(0), current_size_(0) {}
+ MemBackendImpl();
~MemBackendImpl();
// Returns an instance of a Backend implemented only in memory. The returned
diff --git a/net/disk_cache/sparse_control.cc b/net/disk_cache/sparse_control.cc
index 2934184..e94a1bc 100644
--- a/net/disk_cache/sparse_control.cc
+++ b/net/disk_cache/sparse_control.cc
@@ -142,6 +142,17 @@ void ChildrenDeleter::DeleteChildren() {
namespace disk_cache {
+SparseControl::SparseControl(EntryImpl* entry)
+ : entry_(entry),
+ child_(NULL),
+ operation_(kNoOperation),
+ init_(false),
+ child_map_(child_data_.bitmap, kNumSparseBits, kNumSparseBits / 32),
+ ALLOW_THIS_IN_INITIALIZER_LIST(
+ child_callback_(this, &SparseControl::OnChildIOCompleted)),
+ user_callback_(NULL) {
+}
+
SparseControl::~SparseControl() {
if (child_)
CloseChild();
diff --git a/net/disk_cache/sparse_control.h b/net/disk_cache/sparse_control.h
index 88a012b..15704df 100644
--- a/net/disk_cache/sparse_control.h
+++ b/net/disk_cache/sparse_control.h
@@ -40,12 +40,7 @@ class SparseControl {
kGetRangeOperation
};
- explicit SparseControl(EntryImpl* entry)
- : entry_(entry), child_(NULL), operation_(kNoOperation), init_(false),
- child_map_(child_data_.bitmap, kNumSparseBits, kNumSparseBits / 32),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- child_callback_(this, &SparseControl::OnChildIOCompleted)),
- user_callback_(NULL) {}
+ explicit SparseControl(EntryImpl* entry);
~SparseControl();
// Initializes the object for the current entry. If this entry already stores