summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/crash_reporting/minidump_test.cc9
-rw-r--r--chrome_frame/crash_reporting/nt_loader_unittest.cc10
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc13
-rw-r--r--chrome_frame/test/dll_redirector_test.cc12
-rw-r--r--chrome_frame/test/ie_event_sink.cc9
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc5
-rw-r--r--chrome_frame/test/net/fake_external_tab.h8
-rw-r--r--chrome_frame/test/test_server_test.cc7
-rw-r--r--chrome_frame/test/test_with_web_server.h6
-rw-r--r--chrome_frame/test/urlmon_moniker_integration_test.cc5
-rw-r--r--chrome_frame/test_utils.cc12
-rw-r--r--chrome_frame/vtable_patch_manager_unittest.cc8
12 files changed, 55 insertions, 49 deletions
diff --git a/chrome_frame/crash_reporting/minidump_test.cc b/chrome_frame/crash_reporting/minidump_test.cc
index 9b4ef22..106b4df 100644
--- a/chrome_frame/crash_reporting/minidump_test.cc
+++ b/chrome_frame/crash_reporting/minidump_test.cc
@@ -1,6 +1,7 @@
-// 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 <windows.h>
#include <objbase.h>
#include <dbghelp.h>
@@ -11,7 +12,7 @@
#include "base/file_util.h"
#include "base/file_version_info.h"
#include "base/logging.h"
-#include "base/scoped_handle_win.h"
+#include "base/win/scoped_handle.h"
#include "gtest/gtest.h"
namespace {
@@ -277,8 +278,8 @@ class MinidumpTest: public testing::Test {
}
protected:
- ScopedHandle dump_file_handle_;
- ScopedHandle dump_file_mapping_;
+ base::win::ScopedHandle dump_file_handle_;
+ base::win::ScopedHandle dump_file_mapping_;
void* dump_file_view_;
FilePath dump_file_;
diff --git a/chrome_frame/crash_reporting/nt_loader_unittest.cc b/chrome_frame/crash_reporting/nt_loader_unittest.cc
index 2d1f838..eba363e 100644
--- a/chrome_frame/crash_reporting/nt_loader_unittest.cc
+++ b/chrome_frame/crash_reporting/nt_loader_unittest.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.
@@ -10,12 +10,12 @@
#include "base/at_exit.h"
#include "base/environment.h"
#include "base/message_loop.h"
-#include "base/scoped_handle.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/sys_info.h"
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
+#include "base/win/scoped_handle.h"
#include "chrome_frame/crash_reporting/crash_dll.h"
#include "gtest/gtest.h"
@@ -83,7 +83,7 @@ TEST(NtLoader, OwnsCriticalSection) {
other.message_loop()->PostTask(
FROM_HERE, NewRunnableFunction(::EnterCriticalSection, &cs));
- ScopedHandle event(::CreateEvent(NULL, FALSE, FALSE, NULL));
+ base::win::ScopedHandle event(::CreateEvent(NULL, FALSE, FALSE, NULL));
other.message_loop()->PostTask(
FROM_HERE, NewRunnableFunction(::SetEvent, event.Get()));
@@ -125,8 +125,8 @@ TEST(NtLoader, OwnsLoaderLock) {
TEST(NtLoader, GetLoaderEntry) {
// Get all modules in the current process.
- ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,
- ::GetCurrentProcessId()));
+ base::win::ScopedHandle snap(
+ ::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ::GetCurrentProcessId()));
EXPECT_TRUE(snap.Get() != NULL);
// Walk them, while checking we get an entry for each, and that it
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index 2fc8372..51a9025 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.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,12 +16,12 @@
#include "base/file_version_info.h"
#include "base/path_service.h"
#include "base/process_util.h"
-#include "base/scoped_handle.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/stringprintf.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 "ceee/ie/common/ceee_util.h"
#include "chrome/common/chrome_switches.h"
@@ -95,7 +95,8 @@ int CloseVisibleWindowsOnAllThreads(HANDLE process) {
return 0;
}
- ScopedHandle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0));
+ base::win::ScopedHandle snapshot(
+ CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0));
if (!snapshot.IsValid()) {
NOTREACHED();
return 0;
@@ -309,7 +310,7 @@ BOOL LowIntegrityToken::Impersonate() {
return ok;
}
- ScopedHandle process_token(process_token_handle);
+ base::win::ScopedHandle process_token(process_token_handle);
// Create impersonation low integrity token.
HANDLE impersonation_token_handle = NULL;
ok = ::DuplicateTokenEx(process_token,
@@ -322,7 +323,7 @@ BOOL LowIntegrityToken::Impersonate() {
// TODO(stoyan): sandbox/src/restricted_token_utils.cc has
// SetTokenIntegrityLevel function already.
- ScopedHandle impersonation_token(impersonation_token_handle);
+ base::win::ScopedHandle impersonation_token(impersonation_token_handle);
PSID integrity_sid = NULL;
TOKEN_MANDATORY_LABEL tml = {0};
ok = ::ConvertStringSidToSid(SDDL_ML_LOW, &integrity_sid);
@@ -540,7 +541,7 @@ CloseIeAtEndOfScope::~CloseIeAtEndOfScope() {
bool DetectRunningCrashService(int timeout_ms) {
// Wait for the crash_service.exe to be ready for clients.
base::Time start = base::Time::Now();
- ScopedHandle new_pipe;
+ base::win::ScopedHandle new_pipe;
while (true) {
new_pipe.Set(::CreateFile(kCrashServicePipeName,
diff --git a/chrome_frame/test/dll_redirector_test.cc b/chrome_frame/test/dll_redirector_test.cc
index f052cf4..13959dc 100644
--- a/chrome_frame/test/dll_redirector_test.cc
+++ b/chrome_frame/test/dll_redirector_test.cc
@@ -1,14 +1,14 @@
-// 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_frame/dll_redirector.h"
-#include "base/scoped_handle.h"
#include "base/shared_memory.h"
#include "base/sys_info.h"
#include "base/utf_string_conversions.h"
#include "base/version.h"
+#include "base/win/scoped_handle.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "gtest/gtest.h"
@@ -27,8 +27,6 @@ const uint32 kSharedMemorySize = 128;
// before failing.
const uint32 kWaitTestTimeout = 20000;
-using base::win::ScopedHandle;
-
class MockDllRedirector : public DllRedirector {
public:
explicit MockDllRedirector(const char* beacon_name)
@@ -231,8 +229,8 @@ TEST_F(DllRedirectorTest, TestBeaconOwnershipHandoff) {
}
struct LockSquattingThreadParams {
- ScopedHandle is_squatting;
- ScopedHandle time_to_die;
+ base::win::ScopedHandle is_squatting;
+ base::win::ScopedHandle time_to_die;
};
DWORD WINAPI LockSquattingThread(void* in_params) {
@@ -268,7 +266,7 @@ TEST_F(DllRedirectorTest, LockSquatting) {
params.is_squatting.Set(::CreateEvent(NULL, FALSE, FALSE, NULL));
params.time_to_die.Set(::CreateEvent(NULL, FALSE, FALSE, NULL));
DWORD tid = 0;
- ScopedHandle lock_squat_thread(
+ base::win::ScopedHandle lock_squat_thread(
::CreateThread(NULL, 0, LockSquattingThread, &params, 0, &tid));
// Make sure the squatter has started squatting.
diff --git a/chrome_frame/test/ie_event_sink.cc b/chrome_frame/test/ie_event_sink.cc
index 1649e2a..c570558 100644
--- a/chrome_frame/test/ie_event_sink.cc
+++ b/chrome_frame/test/ie_event_sink.cc
@@ -1,14 +1,14 @@
-// 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_frame/test/ie_event_sink.h"
-#include "base/scoped_handle.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "base/win/scoped_bstr.h"
+#include "base/win/scoped_handle.h"
#include "base/win/scoped_variant.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -147,9 +147,8 @@ void IEEventSink::Uninitialize() {
web_browser2_->Quit();
}
- ScopedHandle process;
- process.Set(OpenProcess(SYNCHRONIZE, FALSE,
- ie_process_id_));
+ base::win::ScopedHandle process;
+ process.Set(OpenProcess(SYNCHRONIZE, FALSE, ie_process_id_));
web_browser2_.Release();
if (!process.IsValid()) {
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index 0cb72d1..ca30329 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.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.
@@ -21,6 +21,7 @@
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/threading/platform_thread.h"
+#include "base/win/scoped_handle.h"
#include "chrome/browser/automation/automation_provider_list.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/prefs/browser_prefs.h"
@@ -279,7 +280,7 @@ void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() {
kTestServerPort).c_str());
// Launch IE. This launches IE correctly on Vista too.
- ScopedHandle ie_process(chrome_frame_test::LaunchIE(url));
+ base::win::ScopedHandle ie_process(chrome_frame_test::LaunchIE(url));
EXPECT_TRUE(ie_process.IsValid());
// NOTE: If you're running IE8 and CF is not being loaded, you need to
diff --git a/chrome_frame/test/net/fake_external_tab.h b/chrome_frame/test/net/fake_external_tab.h
index ea7cb6b..9b9842c 100644
--- a/chrome_frame/test/net/fake_external_tab.h
+++ b/chrome_frame/test/net/fake_external_tab.h
@@ -1,22 +1,22 @@
-// Copyright (c) 2009 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.
#ifndef CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_
#define CHROME_FRAME_TEST_NET_FAKE_EXTERNAL_TAB_H_
+#pragma once
#include <string>
#include "base/file_path.h"
#include "base/message_loop.h"
-
+#include "base/win/scoped_handle.h"
#include "chrome/app/scoped_ole_initializer.h"
#include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/browser_thread.h"
#include "chrome_frame/test/test_server.h"
#include "chrome_frame/test/net/test_automation_provider.h"
#include "chrome_frame/test/net/process_singleton_subclass.h"
-
#include "net/base/net_test_suite.h"
class ProcessSingleton;
@@ -87,7 +87,7 @@ class CFUrlRequestUnittestRunner
protected:
protected:
- ScopedHandle test_thread_;
+ base::win::ScopedHandle test_thread_;
DWORD test_thread_id_;
scoped_ptr<test_server::SimpleWebServer> test_http_server_;
diff --git a/chrome_frame/test/test_server_test.cc b/chrome_frame/test/test_server_test.cc
index 9040e22..23073e3e 100644
--- a/chrome_frame/test/test_server_test.cc
+++ b/chrome_frame/test/test_server_test.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.
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "base/path_service.h"
-#include "base/scoped_handle_win.h"
+#include "base/win/scoped_handle.h"
#include "chrome_frame/test/test_server.h"
#include "net/base/cookie_monster.h"
#include "net/base/host_resolver_proc.h"
@@ -192,7 +192,8 @@ TEST_F(TestServerTest, TestServer) {
UrlTaskChain goog_task("http://localhost:1337/goog", &file_task);
DWORD tid = 0;
- ScopedHandle worker(::CreateThread(NULL, 0, FetchUrl, &goog_task, 0, &tid));
+ base::win::ScopedHandle worker(::CreateThread(
+ NULL, 0, FetchUrl, &goog_task, 0, &tid));
loop.MessageLoop::Run();
EXPECT_FALSE(quit_msg.hit_);
diff --git a/chrome_frame/test/test_with_web_server.h b/chrome_frame/test/test_with_web_server.h
index 3b424f3..eaecbef 100644
--- a/chrome_frame/test/test_with_web_server.h
+++ b/chrome_frame/test/test_with_web_server.h
@@ -1,9 +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.
#ifndef CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_
#define CHROME_FRAME_TEST_TEST_WITH_WEB_SERVER_H_
+#pragma once
#include <windows.h>
#include <string>
@@ -11,6 +12,7 @@
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
+#include "base/win/scoped_handle.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/http_server.h"
#include "chrome_frame/test/test_server.h"
@@ -216,7 +218,7 @@ class ChromeFrameTestWithWebServer: public testing::Test {
BrowserKind browser_;
FilePath results_dir_;
- ScopedHandle browser_handle_;
+ base::win::ScopedHandle browser_handle_;
// The on-disk path to our html test files.
FilePath test_file_path_;
diff --git a/chrome_frame/test/urlmon_moniker_integration_test.cc b/chrome_frame/test/urlmon_moniker_integration_test.cc
index 4e9c29b9..b27b90d 100644
--- a/chrome_frame/test/urlmon_moniker_integration_test.cc
+++ b/chrome_frame/test/urlmon_moniker_integration_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 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,6 +6,7 @@
#include <atlcom.h>
#include "base/scoped_comptr_win.h"
+#include "base/win/scoped_handle.h"
#include "base/threading/thread.h"
#include "chrome_frame/bho.h"
//#include "chrome_frame/urlmon_moniker.h"
@@ -82,7 +83,7 @@ class RunTestServer : public base::Thread {
protected:
scoped_ptr<test_server::SimpleWebServer> server_;
test_server::SimpleResponse default_response_;
- ScopedHandle ready_;
+ base::win::ScopedHandle ready_;
};
// Helper class for running tests that rely on the NavigationManager.
diff --git a/chrome_frame/test_utils.cc b/chrome_frame/test_utils.cc
index d146079..65b172d 100644
--- a/chrome_frame/test_utils.cc
+++ b/chrome_frame/test_utils.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.
@@ -13,8 +13,8 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/process_util.h"
-#include "base/scoped_handle.h"
#include "base/string_util.h"
+#include "base/win/scoped_handle.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -177,10 +177,10 @@ bool GetCommandLineForProcess(uint32 process_id, std::wstring* cmd_line) {
DCHECK(cmd_line);
// Open the process
- ScopedHandle process_handle(::OpenProcess(
- PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
- false,
- process_id));
+ base::win::ScopedHandle process_handle(::OpenProcess(
+ PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+ false,
+ process_id));
if (!process_handle) {
DLOG(ERROR) << "Failed to open process " << process_id << ", last error = "
<< GetLastError();
diff --git a/chrome_frame/vtable_patch_manager_unittest.cc b/chrome_frame/vtable_patch_manager_unittest.cc
index 4e04796..842a32a 100644
--- a/chrome_frame/vtable_patch_manager_unittest.cc
+++ b/chrome_frame/vtable_patch_manager_unittest.cc
@@ -1,12 +1,14 @@
-// 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_frame/vtable_patch_manager.h"
+
#include <unknwn.h>
+
#include "base/message_loop.h"
#include "base/threading/thread.h"
-#include "base/scoped_handle.h"
+#include "base/win/scoped_handle.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
@@ -209,7 +211,7 @@ TEST_F(VtablePatchManagerTest, ThreadSafePatching) {
base::Thread background("Background Test Thread");
EXPECT_TRUE(background.Start());
- ScopedHandle event(::CreateEvent(NULL, TRUE, FALSE, NULL));
+ base::win::ScopedHandle event(::CreateEvent(NULL, TRUE, FALSE, NULL));
// Grab the patch lock.
vtable_patch::patch_lock_.Acquire();