summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/aeropeek_manager.cc3
-rw-r--r--chrome/browser/enumerate_modules_model_win.cc6
-rw-r--r--chrome/browser/importer/ie_importer.cc5
-rw-r--r--chrome/browser/memory_details_win.cc9
-rw-r--r--chrome/browser/process_singleton_win.cc7
-rw-r--r--chrome/browser/tab_contents/tab_contents.h8
-rw-r--r--chrome/common/service_process_util_win.cc14
-rw-r--r--chrome/installer/setup/setup_main.cc6
-rw-r--r--chrome/installer/setup/uninstall.cc6
-rw-r--r--chrome/installer/util/package_unittest.cc10
-rw-r--r--chrome/installer/util/product_unittest.cc4
-rw-r--r--chrome/service/service_utility_process_host.cc8
-rw-r--r--chrome/utility/utility_thread.cc5
13 files changed, 51 insertions, 40 deletions
diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc
index 3e1413a..92ce3b8 100644
--- a/chrome/browser/aeropeek_manager.cc
+++ b/chrome/browser/aeropeek_manager.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.
@@ -12,7 +12,6 @@
#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 f7f7f99..8e8ba0b 100644
--- a/chrome/browser/enumerate_modules_model_win.cc
+++ b/chrome/browser/enumerate_modules_model_win.cc
@@ -14,7 +14,6 @@
#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"
@@ -23,6 +22,7 @@
#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.
- ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,
- ::GetCurrentProcessId()));
+ base::win::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 35f4ad4..b26c306 100644
--- a/chrome/browser/importer/ie_importer.cc
+++ b/chrome/browser/importer/ie_importer.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.
@@ -27,6 +27,7 @@
#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"
@@ -49,7 +50,7 @@ namespace {
// Gets the creation time of the given file or directory.
static Time GetFileCreationTime(const std::wstring& file) {
Time creation_time;
- ScopedHandle file_handle(
+ base::win::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 d49a852..4684fd0 100644
--- a/chrome/browser/memory_details_win.cc
+++ b/chrome/browser/memory_details_win.cc
@@ -1,8 +1,9 @@
-// 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.
#include "chrome/browser/memory_details.h"
+
#include <psapi.h>
#include "app/l10n_util.h"
@@ -10,6 +11,7 @@
#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"
@@ -74,7 +76,8 @@ void MemoryDetails::CollectProcessData(
bool is_64bit_os =
system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;
- ScopedHandle snapshot(::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
+ base::win::ScopedHandle snapshot(
+ ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
PROCESSENTRY32 process_entry = {sizeof(PROCESSENTRY32)};
if (!snapshot.Get()) {
LOG(ERROR) << "CreateToolhelp32Snaphot failed: " << GetLastError();
@@ -86,7 +89,7 @@ void MemoryDetails::CollectProcessData(
}
do {
base::ProcessId pid = process_entry.th32ProcessID;
- ScopedHandle handle(::OpenProcess(
+ base::win::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 a52700e..47e28dd 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_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.
@@ -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,7 +53,8 @@ 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!");
- ScopedHandle only_me(CreateMutex(NULL, FALSE, mutex_name.c_str()));
+ base::win::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 79ab5f7..7ef622c 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.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.
@@ -39,6 +39,10 @@
#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;
}
@@ -1280,7 +1284,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.
- ScopedHandle message_box_active_;
+ base::win::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 d30e696..eb784a5 100644
--- a/chrome/common/service_process_util_win.cc
+++ b/chrome/common/service_process_util_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.
@@ -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:
- ScopedHandle shutdown_event_;
+ base::win::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) {
- ScopedHandle shutdown_event;
+ base::win::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();
- ScopedHandle event(
+ base::win::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.
- ScopedHandle ready_event;
+ base::win::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);
- ScopedHandle service_process_ready_event;
+ base::win::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 a204072..8520da5 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.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.
@@ -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.
- ScopedHandle scoped_handle(token);
+ base::win::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 0d3d193..f07e703 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.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.
//
@@ -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);
- ScopedHandle process(::OpenProcess(SYNCHRONIZE, FALSE, pid));
+ base::win::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 851f188..89ed2cb 100644
--- a/chrome/installer/util/package_unittest.cc
+++ b/chrome/installer/util/package_unittest.cc
@@ -1,11 +1,11 @@
-// 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.
#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,7 +16,6 @@
#include "chrome/installer/util/util_constants.h"
using base::win::RegKey;
-using base::win::ScopedHandle;
using installer::ChromePackageProperties;
using installer::ChromiumPackageProperties;
using installer::Package;
@@ -72,8 +71,9 @@ TEST_F(PackageTest, Basic) {
// Hold on to the file exclusively to prevent the directory from
// being deleted.
- ScopedHandle file(::CreateFile(old_chrome_dll.value().c_str(), GENERIC_READ,
- 0, NULL, OPEN_ALWAYS, 0, NULL));
+ base::win::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 b6f8f27..c03b253 100644
--- a/chrome/installer/util/product_unittest.cc
+++ b/chrome/installer/util/product_unittest.cc
@@ -1,11 +1,10 @@
-// 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.
#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"
@@ -16,7 +15,6 @@
#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 859e725..f531169 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.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,10 @@
#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),
@@ -50,7 +54,7 @@ bool ServiceUtilityProcessHost::StartRenderPDFPagesToMetafile(
if (!StartProcess(false, scratch_metafile_dir_->path()))
return false;
- ScopedHandle pdf_file(
+ base::win::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 2349f07..5c2c29e 100644
--- a/chrome/utility/utility_thread.cc
+++ b/chrome/utility/utility_thread.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.
@@ -29,6 +29,7 @@
#if defined(OS_WIN)
#include "app/win/iat_patch_function.h"
+#include "base/win/scoped_handle.h"
#endif
namespace {
@@ -204,7 +205,7 @@ bool UtilityThread::RenderPDFToWinMetafile(
printing::NativeMetafile* metafile,
int* highest_rendered_page_number) {
*highest_rendered_page_number = -1;
- ScopedHandle file(pdf_file);
+ base::win::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());