summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/disk_cache/disk_cache_test_base.cc2
-rw-r--r--net/disk_cache/disk_cache_test_base.h2
-rw-r--r--net/disk_cache/disk_cache_test_util.cc2
-rw-r--r--net/disk_cache/mapped_file.h2
-rw-r--r--net/disk_cache/mapped_file_posix.cc2
-rw-r--r--net/disk_cache/mapped_file_win.cc2
-rw-r--r--net/tools/dump_cache/dump_cache.cc14
-rw-r--r--net/tools/dump_cache/dump_files.cc16
-rw-r--r--net/tools/dump_cache/upgrade.cc6
-rw-r--r--net/url_request/url_request_unittest.cc4
-rw-r--r--net/url_request/url_request_unittest.h2
11 files changed, 27 insertions, 27 deletions
diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc
index 8cb1690..986f3fb 100644
--- a/net/disk_cache/disk_cache_test_base.cc
+++ b/net/disk_cache/disk_cache_test_base.cc
@@ -65,7 +65,7 @@ void DiskCacheTestWithCache::InitDiskCache() {
InitDiskCacheImpl(path);
}
-void DiskCacheTestWithCache::InitDiskCacheImpl(const std::wstring path) {
+void DiskCacheTestWithCache::InitDiskCacheImpl(const std::wstring& path) {
if (mask_)
cache_impl_ = new disk_cache::BackendImpl(path, mask_);
else
diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h
index 317e056..13e866e 100644
--- a/net/disk_cache/disk_cache_test_base.h
+++ b/net/disk_cache/disk_cache_test_base.h
@@ -90,7 +90,7 @@ class DiskCacheTestWithCache : public DiskCacheTest {
private:
void InitMemoryCache();
void InitDiskCache();
- void InitDiskCacheImpl(const std::wstring path);
+ void InitDiskCacheImpl(const std::wstring& path);
};
#endif // NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_
diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc
index e4d3fb7..74de170 100644
--- a/net/disk_cache/disk_cache_test_util.cc
+++ b/net/disk_cache/disk_cache_test_util.cc
@@ -19,7 +19,7 @@ namespace {
std::wstring BuildCachePath(const std::wstring& name) {
FilePath path;
- PathService::Get(base::DIR_TEMP, &path);
+ PathService::Get(base::DIR_TEMP, &path); // Ignore return value;
path = path.Append(FilePath::FromWStringHack(name));
if (!file_util::PathExists(path))
file_util::CreateDirectory(path);
diff --git a/net/disk_cache/mapped_file.h b/net/disk_cache/mapped_file.h
index 215a892..b05e470 100644
--- a/net/disk_cache/mapped_file.h
+++ b/net/disk_cache/mapped_file.h
@@ -26,7 +26,7 @@ class MappedFile : public File {
// Performs object initialization. name is the file to use, and size is the
// ammount of data to memory map from th efile. If size is 0, the whole file
// will be mapped in memory.
- void* Init(const std::wstring name, size_t size);
+ void* Init(const std::wstring& name, size_t size);
void* buffer() const {
return buffer_;
diff --git a/net/disk_cache/mapped_file_posix.cc b/net/disk_cache/mapped_file_posix.cc
index 9f69c4c..b9d8435 100644
--- a/net/disk_cache/mapped_file_posix.cc
+++ b/net/disk_cache/mapped_file_posix.cc
@@ -12,7 +12,7 @@
namespace disk_cache {
-void* MappedFile::Init(const std::wstring name, size_t size) {
+void* MappedFile::Init(const std::wstring& name, size_t size) {
DCHECK(!init_);
if (init_ || !File::Init(name))
return NULL;
diff --git a/net/disk_cache/mapped_file_win.cc b/net/disk_cache/mapped_file_win.cc
index f573a93..4299df4 100644
--- a/net/disk_cache/mapped_file_win.cc
+++ b/net/disk_cache/mapped_file_win.cc
@@ -9,7 +9,7 @@
namespace disk_cache {
-void* MappedFile::Init(const std::wstring name, size_t size) {
+void* MappedFile::Init(const std::wstring& name, size_t size) {
DCHECK(!init_);
if (init_ || !File::Init(name))
return NULL;
diff --git a/net/tools/dump_cache/dump_cache.cc b/net/tools/dump_cache/dump_cache.cc
index 8a58cf5..f14c7a9 100644
--- a/net/tools/dump_cache/dump_cache.cc
+++ b/net/tools/dump_cache/dump_cache.cc
@@ -25,11 +25,11 @@ enum Errors {
TOOL_NOT_FOUND,
};
-int GetMajorVersion(const std::wstring input_path);
-int DumpContents(const std::wstring input_path);
-int DumpHeaders(const std::wstring input_path);
-int RunSlave(const std::wstring input_path, const std::wstring pipe_number);
-int Upgrade(const std::wstring output_path, HANDLE pipe);
+int GetMajorVersion(const std::wstring& input_path);
+int DumpContents(const std::wstring& input_path);
+int DumpHeaders(const std::wstring& input_path);
+int RunSlave(const std::wstring& input_path, const std::wstring& pipe_number);
+int Upgrade(const std::wstring& output_path, HANDLE pipe);
HANDLE CreateServer(std::wstring* pipe_number);
const char kUpgradeHelp[] =
@@ -67,8 +67,8 @@ int Help() {
}
// Starts a new process, to generate the files.
-int LaunchSlave(const CommandLine& command_line, const std::wstring pipe_number,
- int version) {
+int LaunchSlave(const CommandLine& command_line,
+ const std::wstring& pipe_number, int version) {
// TODO(port): remove this string-munging hackery.
std::wstring hacked_command_line = command_line.command_line_string();
const std::wstring old_exe(L"dump_cache.exe");
diff --git a/net/tools/dump_cache/dump_files.cc b/net/tools/dump_cache/dump_files.cc
index 1d8555a..50db69a 100644
--- a/net/tools/dump_cache/dump_files.cc
+++ b/net/tools/dump_cache/dump_files.cc
@@ -23,7 +23,7 @@ const wchar_t kIndexName[] = L"index";
const wchar_t kDataPrefix[] = L"data_";
// Reads the |header_size| bytes from the beginning of file |name|.
-bool ReadHeader(const std::wstring name, char* header, int header_size) {
+bool ReadHeader(const std::wstring& name, char* header, int header_size) {
net::FileStream file;
file.Open(FilePath::FromWStringHack(name),
base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ);
@@ -40,7 +40,7 @@ bool ReadHeader(const std::wstring name, char* header, int header_size) {
return true;
}
-int GetMajorVersionFromFile(const std::wstring name) {
+int GetMajorVersionFromFile(const std::wstring& name) {
disk_cache::IndexHeader header;
if (!ReadHeader(name, reinterpret_cast<char*>(&header), sizeof(header)))
return 0;
@@ -49,7 +49,7 @@ int GetMajorVersionFromFile(const std::wstring name) {
}
// Dumps the contents of the Index-file header.
-void DumpIndexHeader(const std::wstring name) {
+void DumpIndexHeader(const std::wstring& name) {
disk_cache::IndexHeader header;
if (!ReadHeader(name, reinterpret_cast<char*>(&header), sizeof(header)))
return;
@@ -75,7 +75,7 @@ void DumpIndexHeader(const std::wstring name) {
}
// Dumps the contents of a block-file header.
-void DumpBlockHeader(const std::wstring name) {
+void DumpBlockHeader(const std::wstring& name) {
disk_cache::BlockFileHeader header;
if (!ReadHeader(name, reinterpret_cast<char*>(&header), sizeof(header)))
return;
@@ -105,7 +105,7 @@ void DumpBlockHeader(const std::wstring name) {
// Simple class that interacts with the set of cache files.
class CacheDumper {
public:
- explicit CacheDumper(const std::wstring path)
+ explicit CacheDumper(const std::wstring& path)
: path_(path), block_files_(path), index_(NULL) {}
bool Init();
@@ -251,7 +251,7 @@ void DumpRankings(const disk_cache::RankingsNode& rankings) {
// -----------------------------------------------------------------------
-int GetMajorVersion(const std::wstring input_path) {
+int GetMajorVersion(const std::wstring& input_path) {
std::wstring index_name(input_path);
file_util::AppendToPath(&index_name, kIndexName);
@@ -273,7 +273,7 @@ int GetMajorVersion(const std::wstring input_path) {
}
// Dumps the headers of all files.
-int DumpHeaders(const std::wstring input_path) {
+int DumpHeaders(const std::wstring& input_path) {
std::wstring index_name(input_path);
file_util::AppendToPath(&index_name, kIndexName);
DumpIndexHeader(index_name);
@@ -291,7 +291,7 @@ int DumpHeaders(const std::wstring input_path) {
}
// Dumps all entries from the cache.
-int DumpContents(const std::wstring input_path) {
+int DumpContents(const std::wstring& input_path) {
DumpHeaders(input_path);
// We need a message loop, although we really don't run any task.
diff --git a/net/tools/dump_cache/upgrade.cc b/net/tools/dump_cache/upgrade.cc
index 6b4a2da..bf27c9d 100644
--- a/net/tools/dump_cache/upgrade.cc
+++ b/net/tools/dump_cache/upgrade.cc
@@ -23,7 +23,7 @@ const int kNumStreams = 4;
#define DEBUGMSG(...) { printf(__VA_ARGS__); }
#endif
-HANDLE OpenServer(const std::wstring pipe_number) {
+HANDLE OpenServer(const std::wstring& pipe_number) {
std::wstring pipe_name(kPipePrefix);
pipe_name.append(pipe_number);
return CreateFile(pipe_name.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL,
@@ -760,7 +760,7 @@ HANDLE CreateServer(std::wstring* pipe_number) {
}
// This is the controller process for an upgrade operation.
-int Upgrade(const std::wstring output_path, HANDLE pipe) {
+int Upgrade(const std::wstring& output_path, HANDLE pipe) {
MessageLoop loop(MessageLoop::TYPE_IO);
disk_cache::BackendImpl cache(output_path);
if (!cache.Init()) {
@@ -779,7 +779,7 @@ int Upgrade(const std::wstring output_path, HANDLE pipe) {
}
// This process will only execute commands from the controller.
-int RunSlave(const std::wstring input_path, const std::wstring pipe_number) {
+int RunSlave(const std::wstring& input_path, const std::wstring& pipe_number) {
MessageLoop loop(MessageLoop::TYPE_IO);
ScopedHandle pipe(OpenServer(pipe_number));
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 415fb1c..220d7e0 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -906,10 +906,10 @@ TEST_F(URLRequestTest, ResolveShortcutTest) {
result = CoCreateInstance(CLSID_ShellLink, NULL,
CLSCTX_INPROC_SERVER, IID_IShellLink,
reinterpret_cast<LPVOID*>(&shell));
- EXPECT_TRUE(SUCCEEDED(result));
+ ASSERT_TRUE(SUCCEEDED(result));
result = shell->QueryInterface(IID_IPersistFile,
reinterpret_cast<LPVOID*>(&persist));
- EXPECT_TRUE(SUCCEEDED(result));
+ ASSERT_TRUE(SUCCEEDED(result));
result = shell->SetPath(app_path.value().c_str());
EXPECT_TRUE(SUCCEEDED(result));
result = shell->SetDescription(L"ResolveShortcutTest");
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h
index dcc1757..a08d776 100644
--- a/net/url_request/url_request_unittest.h
+++ b/net/url_request/url_request_unittest.h
@@ -477,7 +477,7 @@ class HTTPSTestServer : public HTTPTestServer {
// Create a server with an expired certificate
static scoped_refptr<HTTPSTestServer> CreateExpiredServer(
const std::wstring& document_root) {
- HTTPSTestServer* test_server = new HTTPSTestServer();
+ scoped_refptr<HTTPSTestServer> test_server = new HTTPSTestServer();
FilePath docroot = FilePath::FromWStringHack(document_root);
FilePath certpath = test_server->launcher_.GetExpiredCertPath();
if (!test_server->Start(net::TestServerLauncher::ProtoHTTP,