diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 22:23:58 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 22:23:58 +0000 |
commit | 7d34040372aacc714b5958b6251fdfe1446e5cce (patch) | |
tree | 9d30431e9f588b17be26aca0f04a172b59c08073 /net | |
parent | b888dfe092bc8ea3e485b606ecc23b73955c2d51 (diff) | |
download | chromium_src-7d34040372aacc714b5958b6251fdfe1446e5cce.zip chromium_src-7d34040372aacc714b5958b6251fdfe1446e5cce.tar.gz chromium_src-7d34040372aacc714b5958b6251fdfe1446e5cce.tar.bz2 |
Remove base/scoped_handle_win.h stub and fix up all callers to use the new location and namespace.
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/6126002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 10 | ||||
-rw-r--r-- | net/disk_cache/cache_util_win.cc | 9 | ||||
-rw-r--r-- | net/test/test_server.h | 10 | ||||
-rw-r--r-- | net/test/test_server_win.cc | 9 | ||||
-rw-r--r-- | net/tools/dump_cache/dump_cache.cc | 7 | ||||
-rw-r--r-- | net/tools/dump_cache/upgrade.cc | 5 |
6 files changed, 28 insertions, 22 deletions
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index eaa00eb..05f17f6 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -20,6 +20,10 @@ #include "net/disk_cache/mem_backend_impl.h" #include "testing/gtest/include/gtest/gtest.h" +#if defined(OS_WIN) +#include "base/win/scoped_handle.h" +#endif + using base::Time; // Tests that can run with different types of caches. @@ -1929,8 +1933,8 @@ TEST_F(DiskCacheBackendTest, FileSharing) { #if defined(OS_WIN) DWORD sharing = FILE_SHARE_READ | FILE_SHARE_WRITE; DWORD access = GENERIC_READ | GENERIC_WRITE; - ScopedHandle file2(CreateFile(name.value().c_str(), access, sharing, NULL, - OPEN_EXISTING, 0, NULL)); + base::win::ScopedHandle file2(CreateFile( + name.value().c_str(), access, sharing, NULL, OPEN_EXISTING, 0, NULL)); EXPECT_FALSE(file2.IsValid()); sharing |= FILE_SHARE_DELETE; diff --git a/net/disk_cache/cache_util_win.cc b/net/disk_cache/cache_util_win.cc index cbe6b87..65fc064 100644 --- a/net/disk_cache/cache_util_win.cc +++ b/net/disk_cache/cache_util_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -6,9 +6,10 @@ #include <windows.h> +#include "base/file_util.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/file_util.h" +#include "base/win/scoped_handle.h" namespace { @@ -66,8 +67,8 @@ bool DeleteCacheFile(const FilePath& name) { // us from opening the file again (unless it was deleted). DWORD sharing = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; DWORD access = SYNCHRONIZE; - ScopedHandle file(CreateFile(name.value().c_str(), access, sharing, NULL, - OPEN_EXISTING, 0, NULL)); + base::win::ScopedHandle file(CreateFile( + name.value().c_str(), access, sharing, NULL, OPEN_EXISTING, 0, NULL)); if (file.IsValid()) return false; diff --git a/net/test/test_server.h b/net/test/test_server.h index 9686aef..6d93fc8 100644 --- a/net/test/test_server.h +++ b/net/test/test_server.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -20,7 +20,7 @@ #include "net/base/net_util.h" #if defined(OS_WIN) -#include "base/scoped_handle_win.h" +#include "base/win/scoped_handle.h" #endif class CommandLine; @@ -177,13 +177,13 @@ class TestServer { #if defined(OS_WIN) // JobObject used to clean up orphaned child processes. - ScopedHandle job_handle_; + base::win::ScopedHandle job_handle_; // The pipe file handle we read from. - ScopedHandle child_read_fd_; + base::win::ScopedHandle child_read_fd_; // The pipe file handle the child and we write to. - ScopedHandle child_write_fd_; + base::win::ScopedHandle child_write_fd_; #endif #if defined(OS_POSIX) diff --git a/net/test/test_server_win.cc b/net/test/test_server_win.cc index 075b484..9fc13cd 100644 --- a/net/test/test_server_win.cc +++ b/net/test/test_server_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -17,6 +17,7 @@ #include "base/test/test_timeouts.h" #include "base/threading/thread.h" #include "base/utf_string_conversions.h" +#include "base/win/scoped_handle.h" #pragma comment(lib, "crypt32.lib") @@ -25,7 +26,7 @@ namespace { bool LaunchTestServerAsJob(const CommandLine& cmdline, bool start_hidden, base::ProcessHandle* process_handle, - ScopedHandle* job_handle) { + base::win::ScopedHandle* job_handle) { // Launch test server process. STARTUPINFO startup_info = {0}; startup_info.cb = sizeof(startup_info); @@ -191,8 +192,8 @@ bool TestServer::LaunchPython(const FilePath& testserver_path) { } bool TestServer::WaitToStart() { - ScopedHandle read_fd(child_read_fd_.Take()); - ScopedHandle write_fd(child_write_fd_.Take()); + base::win::ScopedHandle read_fd(child_read_fd_.Take()); + base::win::ScopedHandle write_fd(child_write_fd_.Take()); uint32 server_data_len = 0; if (!ReadData(read_fd.Get(), write_fd.Get(), sizeof(server_data_len), diff --git a/net/tools/dump_cache/dump_cache.cc b/net/tools/dump_cache/dump_cache.cc index 3561fb7..53dd121 100644 --- a/net/tools/dump_cache/dump_cache.cc +++ b/net/tools/dump_cache/dump_cache.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -11,10 +11,9 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "base/process_util.h" -#include "base/scoped_handle.h" #include "base/string_util.h" #include "base/stringprintf.h" - +#include "base/win/scoped_handle.h" #include "net/disk_cache/disk_format.h" enum Errors { @@ -156,7 +155,7 @@ int main(int argc, const char* argv[]) { if (command_line.HasSwitch(kSlave) && slave_required) return RunSlave(input_path, pipe_number); - ScopedHandle server; + base::win::ScopedHandle server; if (slave_required) { server.Set(CreateServer(&pipe_number)); if (!server.IsValid()) { diff --git a/net/tools/dump_cache/upgrade.cc b/net/tools/dump_cache/upgrade.cc index fae924c..7b86237 100644 --- a/net/tools/dump_cache/upgrade.cc +++ b/net/tools/dump_cache/upgrade.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -9,6 +9,7 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/threading/thread.h" +#include "base/win/scoped_handle.h" #include "googleurl/src/gurl.h" #include "net/base/io_buffer.h" #include "net/base/test_completion_callback.h" @@ -912,7 +913,7 @@ int CopyCache(const std::wstring& output_path, HANDLE pipe, bool copy_to_text) { int RunSlave(const std::wstring& input_path, const std::wstring& pipe_number) { MessageLoop loop(MessageLoop::TYPE_IO); - ScopedHandle pipe(OpenServer(pipe_number)); + base::win::ScopedHandle pipe(OpenServer(pipe_number)); if (!pipe.IsValid()) { printf("Unable to open the server pipe\n"); return -1; |