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_frame | |
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_frame')
-rw-r--r-- | chrome_frame/crash_reporting/minidump_test.cc | 9 | ||||
-rw-r--r-- | chrome_frame/crash_reporting/nt_loader_unittest.cc | 10 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.cc | 13 | ||||
-rw-r--r-- | chrome_frame/test/dll_redirector_test.cc | 12 | ||||
-rw-r--r-- | chrome_frame/test/ie_event_sink.cc | 9 | ||||
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 5 | ||||
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.h | 8 | ||||
-rw-r--r-- | chrome_frame/test/test_server_test.cc | 7 | ||||
-rw-r--r-- | chrome_frame/test/test_with_web_server.h | 6 | ||||
-rw-r--r-- | chrome_frame/test/urlmon_moniker_integration_test.cc | 5 | ||||
-rw-r--r-- | chrome_frame/test_utils.cc | 12 | ||||
-rw-r--r-- | chrome_frame/vtable_patch_manager_unittest.cc | 8 |
12 files changed, 49 insertions, 55 deletions
diff --git a/chrome_frame/crash_reporting/minidump_test.cc b/chrome_frame/crash_reporting/minidump_test.cc index 106b4df..9b4ef22 100644 --- a/chrome_frame/crash_reporting/minidump_test.cc +++ b/chrome_frame/crash_reporting/minidump_test.cc @@ -1,7 +1,6 @@ -// 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 <windows.h> #include <objbase.h> #include <dbghelp.h> @@ -12,7 +11,7 @@ #include "base/file_util.h" #include "base/file_version_info.h" #include "base/logging.h" -#include "base/win/scoped_handle.h" +#include "base/scoped_handle_win.h" #include "gtest/gtest.h" namespace { @@ -278,8 +277,8 @@ class MinidumpTest: public testing::Test { } protected: - base::win::ScopedHandle dump_file_handle_; - base::win::ScopedHandle dump_file_mapping_; + ScopedHandle dump_file_handle_; + 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 eba363e..2d1f838 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) 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. @@ -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)); - base::win::ScopedHandle event(::CreateEvent(NULL, FALSE, FALSE, NULL)); + 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. - base::win::ScopedHandle snap( - ::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ::GetCurrentProcessId())); + 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 51a9025..2fc8372 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) 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,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,8 +95,7 @@ int CloseVisibleWindowsOnAllThreads(HANDLE process) { return 0; } - base::win::ScopedHandle snapshot( - CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0)); + ScopedHandle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0)); if (!snapshot.IsValid()) { NOTREACHED(); return 0; @@ -310,7 +309,7 @@ BOOL LowIntegrityToken::Impersonate() { return ok; } - base::win::ScopedHandle process_token(process_token_handle); + ScopedHandle process_token(process_token_handle); // Create impersonation low integrity token. HANDLE impersonation_token_handle = NULL; ok = ::DuplicateTokenEx(process_token, @@ -323,7 +322,7 @@ BOOL LowIntegrityToken::Impersonate() { // TODO(stoyan): sandbox/src/restricted_token_utils.cc has // SetTokenIntegrityLevel function already. - base::win::ScopedHandle impersonation_token(impersonation_token_handle); + ScopedHandle impersonation_token(impersonation_token_handle); PSID integrity_sid = NULL; TOKEN_MANDATORY_LABEL tml = {0}; ok = ::ConvertStringSidToSid(SDDL_ML_LOW, &integrity_sid); @@ -541,7 +540,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(); - base::win::ScopedHandle new_pipe; + 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 13959dc..f052cf4 100644 --- a/chrome_frame/test/dll_redirector_test.cc +++ b/chrome_frame/test/dll_redirector_test.cc @@ -1,14 +1,14 @@ -// 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_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,6 +27,8 @@ 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) @@ -229,8 +231,8 @@ TEST_F(DllRedirectorTest, TestBeaconOwnershipHandoff) { } struct LockSquattingThreadParams { - base::win::ScopedHandle is_squatting; - base::win::ScopedHandle time_to_die; + ScopedHandle is_squatting; + ScopedHandle time_to_die; }; DWORD WINAPI LockSquattingThread(void* in_params) { @@ -266,7 +268,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; - base::win::ScopedHandle lock_squat_thread( + ScopedHandle lock_squat_thread( ::CreateThread(NULL, 0, LockSquattingThread, ¶ms, 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 c570558..1649e2a 100644 --- a/chrome_frame/test/ie_event_sink.cc +++ b/chrome_frame/test/ie_event_sink.cc @@ -1,14 +1,14 @@ -// 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_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,8 +147,9 @@ void IEEventSink::Uninitialize() { web_browser2_->Quit(); } - base::win::ScopedHandle process; - process.Set(OpenProcess(SYNCHRONIZE, FALSE, ie_process_id_)); + 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 ca30329..0cb72d1 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) 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. @@ -21,7 +21,6 @@ #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" @@ -280,7 +279,7 @@ void CFUrlRequestUnittestRunner::StartChromeFrameInHostBrowser() { kTestServerPort).c_str()); // Launch IE. This launches IE correctly on Vista too. - base::win::ScopedHandle ie_process(chrome_frame_test::LaunchIE(url)); + 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 9b9842c..ea7cb6b 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) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 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: - base::win::ScopedHandle test_thread_; + 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 23073e3e..9040e22 100644 --- a/chrome_frame/test/test_server_test.cc +++ b/chrome_frame/test/test_server_test.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. @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/path_service.h" -#include "base/win/scoped_handle.h" +#include "base/scoped_handle_win.h" #include "chrome_frame/test/test_server.h" #include "net/base/cookie_monster.h" #include "net/base/host_resolver_proc.h" @@ -192,8 +192,7 @@ TEST_F(TestServerTest, TestServer) { UrlTaskChain goog_task("http://localhost:1337/goog", &file_task); DWORD tid = 0; - base::win::ScopedHandle worker(::CreateThread( - NULL, 0, FetchUrl, &goog_task, 0, &tid)); + 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 eaecbef..3b424f3 100644 --- a/chrome_frame/test/test_with_web_server.h +++ b/chrome_frame/test/test_with_web_server.h @@ -1,10 +1,9 @@ -// 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. #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> @@ -12,7 +11,6 @@ #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" @@ -218,7 +216,7 @@ class ChromeFrameTestWithWebServer: public testing::Test { BrowserKind browser_; FilePath results_dir_; - base::win::ScopedHandle browser_handle_; + 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 b27b90d..4e9c29b9 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) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 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,7 +6,6 @@ #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" @@ -83,7 +82,7 @@ class RunTestServer : public base::Thread { protected: scoped_ptr<test_server::SimpleWebServer> server_; test_server::SimpleResponse default_response_; - base::win::ScopedHandle ready_; + 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 65b172d..d146079 100644 --- a/chrome_frame/test_utils.cc +++ b/chrome_frame/test_utils.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. @@ -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 - base::win::ScopedHandle process_handle(::OpenProcess( - PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, - false, - process_id)); + 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 842a32a..4e04796 100644 --- a/chrome_frame/vtable_patch_manager_unittest.cc +++ b/chrome_frame/vtable_patch_manager_unittest.cc @@ -1,14 +1,12 @@ -// 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_frame/vtable_patch_manager.h" - #include <unknwn.h> - #include "base/message_loop.h" #include "base/threading/thread.h" -#include "base/win/scoped_handle.h" +#include "base/scoped_handle.h" #include "gtest/gtest.h" #include "gmock/gmock.h" @@ -211,7 +209,7 @@ TEST_F(VtablePatchManagerTest, ThreadSafePatching) { base::Thread background("Background Test Thread"); EXPECT_TRUE(background.Start()); - base::win::ScopedHandle event(::CreateEvent(NULL, TRUE, FALSE, NULL)); + ScopedHandle event(::CreateEvent(NULL, TRUE, FALSE, NULL)); // Grab the patch lock. vtable_patch::patch_lock_.Acquire(); |