diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 23:21:55 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 23:21:55 +0000 |
commit | 15d96941d9694b696f14ce4beaada3907828edc5 (patch) | |
tree | 5c5c8d3eb5cee2388fdd2f26de859e84ddfb6657 /chrome | |
parent | ff81c190a987065d3d3f394af4c1a591417cb5ab (diff) | |
download | chromium_src-15d96941d9694b696f14ce4beaada3907828edc5.zip chromium_src-15d96941d9694b696f14ce4beaada3907828edc5.tar.gz chromium_src-15d96941d9694b696f14ce4beaada3907828edc5.tar.bz2 |
Revert "Remove base/scoped_handle_win.h stub and fix up all callers to use the new location and namespace."
This reverts r 70795, it broke the build.
TBR=vandebo
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/aeropeek_manager.cc | 3 | ||||
-rw-r--r-- | chrome/browser/enumerate_modules_model_win.cc | 6 | ||||
-rw-r--r-- | chrome/browser/importer/ie_importer.cc | 5 | ||||
-rw-r--r-- | chrome/browser/memory_details_win.cc | 9 | ||||
-rw-r--r-- | chrome/browser/process_singleton_win.cc | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 8 | ||||
-rw-r--r-- | chrome/common/service_process_util_win.cc | 14 | ||||
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 6 | ||||
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 6 | ||||
-rw-r--r-- | chrome/installer/util/package_unittest.cc | 10 | ||||
-rw-r--r-- | chrome/installer/util/product_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/service/service_utility_process_host.cc | 8 | ||||
-rw-r--r-- | chrome/utility/utility_thread.cc | 5 |
13 files changed, 40 insertions, 51 deletions
diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc index 92ce3b8..3e1413a 100644 --- a/chrome/browser/aeropeek_manager.cc +++ b/chrome/browser/aeropeek_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -12,6 +12,7 @@ #include "app/win/shell.h" #include "base/command_line.h" #include "base/scoped_comptr_win.h" +#include "base/scoped_handle_win.h" #include "base/scoped_native_library.h" #include "base/synchronization/waitable_event.h" #include "base/win/scoped_gdi_object.h" diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc index 8e8ba0b..f7f7f99 100644 --- a/chrome/browser/enumerate_modules_model_win.cc +++ b/chrome/browser/enumerate_modules_model_win.cc @@ -14,6 +14,7 @@ #include "base/file_path.h" #include "base/file_version_info_win.h" #include "base/metrics/histogram.h" +#include "base/scoped_handle.h" #include "base/sha2.h" #include "base/string_number_conversions.h" #include "base/string_util.h" @@ -22,7 +23,6 @@ #include "base/values.h" #include "base/version.h" #include "base/win/registry.h" -#include "base/win/scoped_handle.h" #include "chrome/browser/net/service_providers_win.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" @@ -384,8 +384,8 @@ void ModuleEnumerator::ScanImpl() { void ModuleEnumerator::EnumerateLoadedModules() { // Get all modules in the current process. - base::win::ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, - ::GetCurrentProcessId())); + ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, + ::GetCurrentProcessId())); if (!snap.Get()) return; diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc index b26c306..35f4ad4 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -27,7 +27,6 @@ #include "base/values.h" #include "base/utf_string_conversions.h" #include "base/win/registry.h" -#include "base/win/scoped_handle.h" #include "base/win/windows_version.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/importer/importer_bridge.h" @@ -50,7 +49,7 @@ namespace { // Gets the creation time of the given file or directory. static Time GetFileCreationTime(const std::wstring& file) { Time creation_time; - base::win::ScopedHandle file_handle( + ScopedHandle file_handle( CreateFile(file.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc index 4684fd0..d49a852 100644 --- a/chrome/browser/memory_details_win.cc +++ b/chrome/browser/memory_details_win.cc @@ -1,9 +1,8 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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 "chrome/browser/memory_details.h" - #include <psapi.h> #include "app/l10n_util.h" @@ -11,7 +10,6 @@ #include "base/file_version_info.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "base/win/scoped_handle.h" #include "chrome/browser/browser_child_process_host.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/renderer_host/backing_store_manager.h" @@ -76,8 +74,7 @@ void MemoryDetails::CollectProcessData( bool is_64bit_os = system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; - base::win::ScopedHandle snapshot( - ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)); + ScopedHandle snapshot(::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)); PROCESSENTRY32 process_entry = {sizeof(PROCESSENTRY32)}; if (!snapshot.Get()) { LOG(ERROR) << "CreateToolhelp32Snaphot failed: " << GetLastError(); @@ -89,7 +86,7 @@ void MemoryDetails::CollectProcessData( } do { base::ProcessId pid = process_entry.th32ProcessID; - base::win::ScopedHandle handle(::OpenProcess( + ScopedHandle handle(::OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid)); if (!handle.Get()) continue; diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc index 47e28dd..a52700e 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -11,8 +11,8 @@ #include "base/file_path.h" #include "base/path_service.h" #include "base/process_util.h" +#include "base/scoped_handle.h" #include "base/utf_string_conversions.h" -#include "base/win/scoped_handle.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extensions_startup.h" #include "chrome/browser/platform_util.h" @@ -53,8 +53,7 @@ ProcessSingleton::ProcessSingleton(const FilePath& user_data_dir) // since it isn't guaranteed we will get it. It is better to create it // without ownership and explicitly get the ownership afterward. std::wstring mutex_name(L"Local\\ChromeProcessSingletonStartup!"); - base::win::ScopedHandle only_me( - CreateMutex(NULL, FALSE, mutex_name.c_str())); + ScopedHandle only_me(CreateMutex(NULL, FALSE, mutex_name.c_str())); DCHECK(only_me.Get() != NULL) << "GetLastError = " << GetLastError(); // This is how we acquire the mutex (as opposed to the initial ownership). diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 7ef622c..79ab5f7 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -39,10 +39,6 @@ #include "gfx/native_widget_types.h" #include "net/base/load_states.h" -#if defined(OS_WIN) -#include "base/win/scoped_handle.h" -#endif - namespace gfx { class Rect; } @@ -1284,7 +1280,7 @@ class TabContents : public PageNavigator, // Handle to an event that's set when the page is showing a message box (or // equivalent constrained window). Plugin processes check this to know if // they should pump messages then. - base::win::ScopedHandle message_box_active_; + ScopedHandle message_box_active_; #endif // The time that the last javascript message was dismissed. diff --git a/chrome/common/service_process_util_win.cc b/chrome/common/service_process_util_win.cc index eb784a5..d30e696 100644 --- a/chrome/common/service_process_util_win.cc +++ b/chrome/common/service_process_util_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -8,10 +8,10 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/path_service.h" +#include "base/scoped_handle_win.h" #include "base/string16.h" #include "base/utf_string_conversions.h" #include "base/win/object_watcher.h" -#include "base/win/scoped_handle.h" #include "base/win/win_util.h" #include "chrome/common/chrome_switches.h" @@ -47,7 +47,7 @@ class ServiceProcessShutdownMonitor } private: - base::win::ScopedHandle shutdown_event_; + ScopedHandle shutdown_event_; base::win::ObjectWatcher watcher_; scoped_ptr<Task> shutdown_task_; }; @@ -55,7 +55,7 @@ class ServiceProcessShutdownMonitor } // namespace bool ForceServiceProcessShutdown(const std::string& version) { - base::win::ScopedHandle shutdown_event; + ScopedHandle shutdown_event; std::string versioned_name = version; versioned_name.append("_service_shutdown_evt"); string16 event_name = @@ -69,7 +69,7 @@ bool ForceServiceProcessShutdown(const std::string& version) { bool CheckServiceProcessReady() { string16 event_name = GetServiceProcessReadyEventName(); - base::win::ScopedHandle event( + ScopedHandle event( OpenEvent(SYNCHRONIZE | READ_CONTROL, false, event_name.c_str())); if (!event.IsValid()) return false; @@ -79,7 +79,7 @@ bool CheckServiceProcessReady() { struct ServiceProcessState::StateData { // An event that is signaled when a service process is ready. - base::win::ScopedHandle ready_event; + ScopedHandle ready_event; scoped_ptr<ServiceProcessShutdownMonitor> shutdown_monitor; }; @@ -87,7 +87,7 @@ bool ServiceProcessState::TakeSingletonLock() { DCHECK(!state_); string16 event_name = GetServiceProcessReadyEventName(); CHECK(event_name.length() <= MAX_PATH); - base::win::ScopedHandle service_process_ready_event; + ScopedHandle service_process_ready_event; service_process_ready_event.Set( CreateEvent(NULL, TRUE, FALSE, event_name.c_str())); DWORD error = GetLastError(); diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 8520da5..a204072 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -16,11 +16,11 @@ #include "base/file_version_info.h" #include "base/path_service.h" #include "base/process_util.h" +#include "base/scoped_handle_win.h" #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/values.h" -#include "base/win/scoped_handle.h" #include "base/win/win_util.h" #include "base/win/windows_version.h" #include "breakpad/src/client/windows/handler/exception_handler.h" @@ -694,7 +694,7 @@ bool ShowRebootDialog() { // Use a ScopedHandle to keep track of and eventually close our handle. // TODO(robertshield): Add a Receive() method to base's ScopedHandle. - base::win::ScopedHandle scoped_handle(token); + ScopedHandle scoped_handle(token); // Get the LUID for the shutdown privilege. TOKEN_PRIVILEGES tkp = {0}; diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index f07e703..0d3d193 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. // @@ -8,11 +8,11 @@ #include "base/file_util.h" #include "base/path_service.h" +#include "base/scoped_handle.h" #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "base/win/registry.h" -#include "base/win/scoped_handle.h" #include "base/win/windows_version.h" #include "chrome/common/result_codes.h" #include "chrome/common/chrome_constants.h" @@ -146,7 +146,7 @@ void CloseChromeFrameHelperProcess() { DWORD pid = 0; ::GetWindowThreadProcessId(window, &pid); DCHECK_NE(pid, 0U); - base::win::ScopedHandle process(::OpenProcess(SYNCHRONIZE, FALSE, pid)); + ScopedHandle process(::OpenProcess(SYNCHRONIZE, FALSE, pid)); PLOG_IF(INFO, !process) << "Failed to open process: " << pid; bool kill = true; diff --git a/chrome/installer/util/package_unittest.cc b/chrome/installer/util/package_unittest.cc index 89ed2cb..851f188 100644 --- a/chrome/installer/util/package_unittest.cc +++ b/chrome/installer/util/package_unittest.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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 "base/command_line.h" #include "base/logging.h" +#include "base/scoped_handle.h" #include "base/utf_string_conversions.h" -#include "base/win/scoped_handle.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/master_preferences.h" @@ -16,6 +16,7 @@ #include "chrome/installer/util/util_constants.h" using base::win::RegKey; +using base::win::ScopedHandle; using installer::ChromePackageProperties; using installer::ChromiumPackageProperties; using installer::Package; @@ -71,9 +72,8 @@ TEST_F(PackageTest, Basic) { // Hold on to the file exclusively to prevent the directory from // being deleted. - base::win::ScopedHandle file( - ::CreateFile(old_chrome_dll.value().c_str(), GENERIC_READ, - 0, NULL, OPEN_ALWAYS, 0, NULL)); + ScopedHandle file(::CreateFile(old_chrome_dll.value().c_str(), GENERIC_READ, + 0, NULL, OPEN_ALWAYS, 0, NULL)); EXPECT_TRUE(file.IsValid()); EXPECT_TRUE(file_util::PathExists(old_chrome_dll)); diff --git a/chrome/installer/util/product_unittest.cc b/chrome/installer/util/product_unittest.cc index c03b253..b6f8f27 100644 --- a/chrome/installer/util/product_unittest.cc +++ b/chrome/installer/util/product_unittest.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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 "chrome/installer/util/product_unittest.h" #include "base/logging.h" +#include "base/scoped_handle.h" #include "base/utf_string_conversions.h" #include "chrome/installer/util/chrome_frame_distribution.h" #include "chrome/installer/util/google_update_constants.h" @@ -15,6 +16,7 @@ #include "chrome/installer/util/product.h" using base::win::RegKey; +using base::win::ScopedHandle; using installer::ChromePackageProperties; using installer::ChromiumPackageProperties; using installer::Package; diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc index f531169..859e725 100644 --- a/chrome/service/service_utility_process_host.cc +++ b/chrome/service/service_utility_process_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -17,10 +17,6 @@ #include "printing/native_metafile.h" #include "printing/page_range.h" -#if defined(OS_WIN) -#include "base/win/scoped_handle.h" -#endif - ServiceUtilityProcessHost::ServiceUtilityProcessHost( Client* client, base::MessageLoopProxy* client_message_loop_proxy) : ServiceChildProcessHost(ChildProcessInfo::UTILITY_PROCESS), @@ -54,7 +50,7 @@ bool ServiceUtilityProcessHost::StartRenderPDFPagesToMetafile( if (!StartProcess(false, scratch_metafile_dir_->path())) return false; - base::win::ScopedHandle pdf_file( + ScopedHandle pdf_file( ::CreateFile(pdf_path.value().c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, diff --git a/chrome/utility/utility_thread.cc b/chrome/utility/utility_thread.cc index 5c2c29e..2349f07 100644 --- a/chrome/utility/utility_thread.cc +++ b/chrome/utility/utility_thread.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -29,7 +29,6 @@ #if defined(OS_WIN) #include "app/win/iat_patch_function.h" -#include "base/win/scoped_handle.h" #endif namespace { @@ -205,7 +204,7 @@ bool UtilityThread::RenderPDFToWinMetafile( printing::NativeMetafile* metafile, int* highest_rendered_page_number) { *highest_rendered_page_number = -1; - base::win::ScopedHandle file(pdf_file); + ScopedHandle file(pdf_file); FilePath pdf_module_path; PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_module_path); HMODULE pdf_module = GetModuleHandle(pdf_module_path.value().c_str()); |