Add Terminate() to the Process object, have RenderProcessHost use this to avoid some more Windows specific code.
Move Process and SharedMemory into the base namespace (most changes).
Review URL: http://codereview.chromium.org/10895
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5446 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/clipboard.h b/base/clipboard.h
index a91d6cb..af1ac5a8 100644
--- a/base/clipboard.h
+++ b/base/clipboard.h
@@ -90,7 +90,7 @@
// the objects, it came from the process designated by |process|. This will
// assist in turning it into a shared memory region that the current process
// can use.
- void WriteObjects(const ObjectMap& objects, ProcessHandle process);
+ void WriteObjects(const ObjectMap& objects, base::ProcessHandle process);
// Tests whether the clipboard contains a certain format
bool IsFormatAvailable(FormatType format) const;
@@ -160,7 +160,7 @@
void WriteBitmapFromSharedMemory(const char* bitmap_data,
const char* size_data,
- ProcessHandle handle);
+ base::ProcessHandle handle);
void WriteBitmapFromHandle(HBITMAP source_hbitmap,
const gfx::Size& size);
diff --git a/base/clipboard_win.cc b/base/clipboard_win.cc
index affb520..814065d 100644
--- a/base/clipboard_win.cc
+++ b/base/clipboard_win.cc
@@ -147,7 +147,8 @@
WriteObjects(objects, NULL);
}
-void Clipboard::WriteObjects(const ObjectMap& objects, ProcessHandle process) {
+void Clipboard::WriteObjects(const ObjectMap& objects,
+ base::ProcessHandle process) {
ScopedClipboard clipboard;
if (!clipboard.Acquire(clipboard_owner_))
return;
@@ -267,12 +268,12 @@
void Clipboard::WriteBitmapFromSharedMemory(const char* bitmap_data,
const char* size_data,
- ProcessHandle process) {
- const SharedMemoryHandle* remote_bitmap_handle =
- reinterpret_cast<const SharedMemoryHandle*>(bitmap_data);
+ base::ProcessHandle process) {
+ const base::SharedMemoryHandle* remote_bitmap_handle =
+ reinterpret_cast<const base::SharedMemoryHandle*>(bitmap_data);
const gfx::Size* size = reinterpret_cast<const gfx::Size*>(size_data);
- SharedMemory bitmap(*remote_bitmap_handle, false, process);
+ base::SharedMemory bitmap(*remote_bitmap_handle, false, process);
// TODO(darin): share data in gfx/bitmap_header.cc somehow
BITMAPINFO bm_info = {0};
diff --git a/base/gfx/platform_canvas_win.cc b/base/gfx/platform_canvas_win.cc
index f2c69ac..fe90c55 100644
--- a/base/gfx/platform_canvas_win.cc
+++ b/base/gfx/platform_canvas_win.cc
@@ -34,8 +34,8 @@
// If we're using a crazy amount of virtual address space, then maybe there
// isn't enough for our bitmap.
const int64 kLotsOfMem = 1500000000; // 1.5GB.
- scoped_ptr<process_util::ProcessMetrics> process_metrics(
- process_util::ProcessMetrics::CreateProcessMetrics(GetCurrentProcess()));
+ scoped_ptr<base::ProcessMetrics> process_metrics(
+ base::ProcessMetrics::CreateProcessMetrics(GetCurrentProcess()));
CHECK(process_metrics->GetPagefileUsage() < kLotsOfMem);
// Everything else.
diff --git a/base/multiprocess_test.h b/base/multiprocess_test.h
index 69aa50b5..a85334e 100644
--- a/base/multiprocess_test.h
+++ b/base/multiprocess_test.h
@@ -51,14 +51,14 @@
//
// TODO(darin): re-enable this once we have base/debug_util.h
// ProcessDebugFlags(&cl, DebugUtil::UNKNOWN, false);
- ProcessHandle SpawnChild(const std::wstring& procname) {
+ base::ProcessHandle SpawnChild(const std::wstring& procname) {
CommandLine cl;
- ProcessHandle handle = static_cast<ProcessHandle>(NULL);
+ base::ProcessHandle handle = static_cast<base::ProcessHandle>(NULL);
#if defined(OS_WIN)
std::wstring clstr = cl.command_line_string();
CommandLine::AppendSwitchWithValue(&clstr, kRunClientProcess, procname);
- process_util::LaunchApp(clstr, false, true, &handle);
+ base::LaunchApp(clstr, false, true, &handle);
#elif defined(OS_POSIX)
std::vector<std::string> clvec(cl.argv());
std::wstring wswitchstr =
@@ -66,7 +66,7 @@
procname);
std::string switchstr = WideToUTF8(wswitchstr);
clvec.push_back(switchstr.c_str());
- process_util::LaunchApp(clvec, false, &handle);
+ base::LaunchApp(clvec, false, &handle);
#endif
return handle;
diff --git a/base/process.h b/base/process.h
index 806b1de..7be16e08 100644
--- a/base/process.h
+++ b/base/process.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_PROCESS_H__
-#define BASE_PROCESS_H__
+#ifndef BASE_PROCESS_H_
+#define BASE_PROCESS_H_
#include "base/basictypes.h"
@@ -11,6 +11,8 @@
#include <windows.h>
#endif
+namespace base {
+
// ProcessHandle is a platform specific type which represents the underlying OS
// handle to a process.
#if defined(OS_WIN)
@@ -20,9 +22,6 @@
typedef int ProcessHandle;
#endif
-// A Process
-// TODO(mbelshe): Replace existing code which uses the ProcessHandle w/ the
-// Process object where relevant.
class Process {
public:
Process() : process_(0), last_working_set_size_(0) {}
@@ -43,13 +42,13 @@
// Is the this process the current process.
bool is_current() const;
- // Close the Process Handle.
- void Close() {
-#ifdef OS_WIN
- CloseHandle(process_);
-#endif
- process_ = 0;
- }
+ // Close the process handle. This will not terminate the process.
+ void Close();
+
+ // Terminates the process with extreme prejudice. The given result code will
+ // be the exit code of the process. If the process has already exited, this
+ // will do nothing.
+ void Terminate(int result_code);
// A process is backgrounded when it's priority is lower than normal.
// Return true if this process is backgrounded, false otherwise.
@@ -85,5 +84,7 @@
size_t last_working_set_size_;
};
-#endif // BASE_PROCESS_H__
+} // namespace base
+
+#endif // BASE_PROCESS_H_
diff --git a/base/process_posix.cc b/base/process_posix.cc
index 73711db..8d210ba 100644
--- a/base/process_posix.cc
+++ b/base/process_posix.cc
@@ -6,6 +6,16 @@
#include "base/logging.h"
#include "base/process_util.h"
+namespace base {
+
+void Process::Close() {
+ process_ = 0;
+}
+
+void Process::Terminate() {
+ NOTIMPLEMENTED();
+}
+
bool Process::IsProcessBackgrounded() const {
return false;
}
@@ -46,3 +56,4 @@
return Process(process_util::GetCurrentProcessHandle());
}
+} // namspace base
diff --git a/base/process_util.h b/base/process_util.h
index 3f777a69..5146c12 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -44,7 +44,7 @@
};
#endif
-namespace process_util {
+namespace base {
// A minimalistic but hopefully cross-platform set of exit codes.
// Do not change the enumeration values or you will break third-party
@@ -322,6 +322,6 @@
// the current process's scheduling priority to a high priority.
void RaiseProcessToHighPriority();
-} // namespace process_util
+} // namespace base
#endif // BASE_PROCESS_UTIL_H_
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 2dba808..1c31f9f 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -25,7 +25,7 @@
} // namespace
-namespace process_util {
+namespace base {
bool LaunchApp(const std::vector<std::string>& argv,
bool wait, ProcessHandle* process_handle) {
@@ -327,4 +327,4 @@
return -1;
}
-} // namespace process_util
+} // namespace base
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 4073afd7..7e8b9a2 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -15,7 +15,8 @@
#include <dlfcn.h>
#endif
-namespace {
+namespace base {
+
class ProcessUtilTest : public MultiProcessTest {
};
@@ -27,7 +28,7 @@
ProcessHandle handle = this->SpawnChild(L"SimpleChildProcess");
ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
- EXPECT_TRUE(process_util::WaitForSingleProcess(handle, 1000));
+ EXPECT_TRUE(WaitForSingleProcess(handle, 1000));
}
MULTIPROCESS_TEST_MAIN(SlowChildProcess) {
@@ -53,24 +54,24 @@
#if !defined(OS_MACOSX)
TEST_F(ProcessUtilTest, KillSlowChild) {
remove("SlowChildProcess.die");
- int oldcount = process_util::GetProcessCount(L"base_unittests" EXE_SUFFIX, 0);
+ int oldcount = GetProcessCount(L"base_unittests" EXE_SUFFIX, 0);
ProcessHandle handle = this->SpawnChild(L"SlowChildProcess");
ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
- EXPECT_EQ(oldcount+1, process_util::GetProcessCount(L"base_unittests" EXE_SUFFIX, 0));
+ EXPECT_EQ(oldcount+1, GetProcessCount(L"base_unittests" EXE_SUFFIX, 0));
FILE *fp = fopen("SlowChildProcess.die", "w");
fclose(fp);
// TODO(port): do something less racy here
PlatformThread::Sleep(1000);
- EXPECT_EQ(oldcount, process_util::GetProcessCount(L"base_unittests" EXE_SUFFIX, 0));
+ EXPECT_EQ(oldcount, GetProcessCount(L"base_unittests" EXE_SUFFIX, 0));
}
#endif
// TODO(estade): if possible, port these 2 tests.
#if defined(OS_WIN)
TEST_F(ProcessUtilTest, EnableLFH) {
- ASSERT_TRUE(process_util::EnableLowFragmentationHeap());
+ ASSERT_TRUE(EnableLowFragmentationHeap());
if (IsDebuggerPresent()) {
// Under these conditions, LFH can't be enabled. There's no point to test
// anything.
@@ -101,13 +102,13 @@
}
TEST_F(ProcessUtilTest, CalcFreeMemory) {
- process_util::ProcessMetrics* metrics =
- process_util::ProcessMetrics::CreateProcessMetrics(::GetCurrentProcess());
+ ProcessMetrics* metrics =
+ ProcessMetrics::CreateProcessMetrics(::GetCurrentProcess());
ASSERT_TRUE(NULL != metrics);
// Typical values here is ~1900 for total and ~1000 for largest. Obviously
// it depends in what other tests have done to this process.
- process_util::FreeMBytes free_mem1 = {0};
+ FreeMBytes free_mem1 = {0};
EXPECT_TRUE(metrics->CalculateFreeMemory(&free_mem1));
EXPECT_LT(10u, free_mem1.total);
EXPECT_LT(10u, free_mem1.largest);
@@ -124,7 +125,7 @@
size_t expected_total = free_mem1.total - kAllocMB;
size_t expected_largest = free_mem1.largest;
- process_util::FreeMBytes free_mem2 = {0};
+ FreeMBytes free_mem2 = {0};
EXPECT_TRUE(metrics->CalculateFreeMemory(&free_mem2));
EXPECT_GE(free_mem2.total, free_mem2.largest);
EXPECT_GE(expected_total, free_mem2.total);
@@ -136,4 +137,4 @@
}
#endif // defined(OS_WIN)
-} // namespace
+} // namespace base
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index d12f167..d163e305 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -22,7 +22,7 @@
} // namespace
-namespace process_util {
+namespace base {
int GetCurrentProcId() {
return ::GetCurrentProcessId();
@@ -329,11 +329,11 @@
int wait_milliseconds,
int exit_code,
const ProcessFilter* filter) {
- bool exited_cleanly =
- process_util::WaitForProcessesToExit(executable_name, wait_milliseconds,
- filter);
+ bool exited_cleanly = WaitForProcessesToExit(executable_name,
+ wait_milliseconds,
+ filter);
if (!exited_cleanly)
- process_util::KillProcesses(executable_name, exit_code, filter);
+ KillProcesses(executable_name, exit_code, filter);
return exited_cleanly;
}
@@ -615,4 +615,4 @@
SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
}
-} // namespace process_util
+} // namespace base
diff --git a/base/process_win.cc b/base/process_win.cc
index 7a60854..697a020 100644
--- a/base/process_win.cc
+++ b/base/process_win.cc
@@ -7,6 +7,21 @@
#include "base/process_util.h"
#include "base/scoped_ptr.h"
+namespace base {
+
+void Process::Close() {
+ if (!process_)
+ return;
+ ::CloseHandle(process_);
+ process_ = NULL;
+}
+
+void Process::Terminate(int result_code) {
+ if (!process_)
+ return;
+ ::TerminateProcess(process_, result_code);
+}
+
bool Process::IsProcessBackgrounded() const {
DCHECK(process_);
DWORD priority = GetPriorityClass(process_);
@@ -43,9 +58,9 @@
// The intended algorithm is:
// TargetWorkingSetSize = (LastWorkingSet/2 + CurrentWorkingSet) /2
- scoped_ptr<process_util::ProcessMetrics> metrics(
- process_util::ProcessMetrics::CreateProcessMetrics(process_));
- process_util::WorkingSetKBytes working_set;
+ scoped_ptr<ProcessMetrics> metrics(
+ ProcessMetrics::CreateProcessMetrics(process_));
+ WorkingSetKBytes working_set;
if (!metrics->GetWorkingSetKBytes(&working_set))
return false;
@@ -96,7 +111,7 @@
if (process_ == 0)
return 0;
- return process_util::GetProcId(process_);
+ return GetProcId(process_);
}
bool Process::is_current() const {
@@ -108,3 +123,4 @@
return Process(GetCurrentProcess());
}
+} // namespace base
diff --git a/base/run_all_perftests.cc b/base/run_all_perftests.cc
index 1ecf8d1..c0b91c1 100644
--- a/base/run_all_perftests.cc
+++ b/base/run_all_perftests.cc
@@ -25,7 +25,7 @@
// Raise to high priority to have more precise measurements. Since we don't
// aim at 1% precision, it is not necessary to run at realtime level.
if (!DebugUtil::BeingDebugged())
- process_util::RaiseProcessToHighPriority();
+ base::RaiseProcessToHighPriority();
TestSuite::Initialize();
}
diff --git a/base/run_all_unittests.cc b/base/run_all_unittests.cc
index 4ab019a..e7c7b37 100644
--- a/base/run_all_unittests.cc
+++ b/base/run_all_unittests.cc
@@ -6,6 +6,6 @@
#include "base/test_suite.h"
int main(int argc, char** argv) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
return TestSuite(argc, argv).Run();
}
diff --git a/base/shared_memory.h b/base/shared_memory.h
index 358b7b59..34420ce 100644
--- a/base/shared_memory.h
+++ b/base/shared_memory.h
@@ -9,6 +9,8 @@
#include "base/basictypes.h"
#include "base/process.h"
+namespace base {
+
// SharedMemoryHandle is a platform specific type which represents
// the underlying OS handle to a shared memory segment.
#if defined(OS_WIN)
@@ -35,7 +37,7 @@
// shared memory file that was created by a remote process and not shared
// to the current process.
SharedMemory(SharedMemoryHandle handle, bool read_only,
- ProcessHandle process);
+ base::ProcessHandle process);
// Destructor. Will close any open files.
~SharedMemory();
@@ -89,7 +91,7 @@
// file. new_handle is an ouput parameter to receive
// the handle for use in the remote process.
// Returns true on success, false otherwise.
- bool ShareToProcess(ProcessHandle process,
+ bool ShareToProcess(base::ProcessHandle process,
SharedMemoryHandle* new_handle) {
return ShareToProcessCommon(process, new_handle, false);
}
@@ -147,5 +149,6 @@
DISALLOW_EVIL_CONSTRUCTORS(SharedMemoryAutoLock);
};
+} // namespace base
#endif // BASE_SHARED_MEMORY_H_
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index 3e6d9eb1..5f0c05c 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -10,6 +10,8 @@
#include "base/logging.h"
#include "base/string_util.h"
+namespace base {
+
namespace {
// Paranoia. Semaphores and shared memory segments should live in different
// namespaces, but who knows what's out there.
@@ -166,3 +168,4 @@
sem_post(lock_);
}
+} // namespace base
diff --git a/base/shared_memory_unittest.cc b/base/shared_memory_unittest.cc
index 599352d..0c3e464 100644
--- a/base/shared_memory_unittest.cc
+++ b/base/shared_memory_unittest.cc
@@ -9,10 +9,9 @@
static const int kNumThreads = 5;
-namespace {
+namespace base {
-class SharedMemoryTest : public testing::Test {
-};
+namespace {
// Each thread will open the shared memory. Each thread will take a different 4
// byte int pointer, and keep changing it, with some small pauses in between.
@@ -181,3 +180,5 @@
}
}
#endif
+
+} // namespace base
diff --git a/base/shared_memory_win.cc b/base/shared_memory_win.cc
index ea81d431..4c56a70 100644
--- a/base/shared_memory_win.cc
+++ b/base/shared_memory_win.cc
@@ -7,6 +7,8 @@
#include "base/logging.h"
#include "base/win_util.h"
+namespace base {
+
SharedMemory::SharedMemory()
: mapped_file_(NULL),
memory_(NULL),
@@ -161,3 +163,4 @@
ReleaseMutex(lock_);
}
+} // namespace base
diff --git a/base/stats_table.cc b/base/stats_table.cc
index 061de0d..72cc5ab 100644
--- a/base/stats_table.cc
+++ b/base/stats_table.cc
@@ -112,7 +112,7 @@
static StatsTablePrivate* New(const std::wstring& name, int size,
int max_threads, int max_counters);
- SharedMemory* shared_memory() { return &shared_memory_; }
+ base::SharedMemory* shared_memory() { return &shared_memory_; }
// Accessors for our header pointers
TableHeader* table_header() const { return table_header_; }
@@ -152,7 +152,7 @@
// Initializes our in-memory pointers into a pre-created StatsTable.
void ComputeMappedPointers(void* memory);
- SharedMemory shared_memory_;
+ base::SharedMemory shared_memory_;
TableHeader* table_header_;
wchar_t* thread_names_table_;
int* thread_tid_table_;
@@ -289,7 +289,7 @@
// so that two threads don't grab the same slot. Fortunately,
// thread creation shouldn't happen in inner loops.
{
- SharedMemoryAutoLock lock(impl_->shared_memory());
+ base::SharedMemoryAutoLock lock(impl_->shared_memory());
slot = FindEmptyThread();
if (!slot) {
return 0;
@@ -304,7 +304,7 @@
base::wcslcpy(impl_->thread_name(slot), thread_name.c_str(),
kMaxThreadNameLength);
*(impl_->thread_tid(slot)) = PlatformThread::CurrentId();
- *(impl_->thread_pid(slot)) = process_util::GetCurrentProcId();
+ *(impl_->thread_pid(slot)) = base::GetCurrentProcId();
}
// Set our thread local storage.
@@ -454,7 +454,7 @@
{
// To add a counter to the shared memory, we need the
// shared memory lock.
- SharedMemoryAutoLock lock(impl_->shared_memory());
+ base::SharedMemoryAutoLock lock(impl_->shared_memory());
// We have space, so create a new counter.
counter_id = FindCounterOrEmptyRow(name);
diff --git a/base/stats_table_unittest.cc b/base/stats_table_unittest.cc
index 0ce99b77..68a07ac 100644
--- a/base/stats_table_unittest.cc
+++ b/base/stats_table_unittest.cc
@@ -16,9 +16,8 @@
#include <windows.h>
#endif
-using base::TimeTicks;
+namespace base {
-namespace {
class StatsTableTest : public MultiProcessTest {
};
@@ -199,7 +198,7 @@
// Wait for the processes to finish.
for (int index = 0; index < kMaxProcs; index++) {
- EXPECT_TRUE(process_util::WaitForSingleProcess(procs[index], 60 * 1000));
+ EXPECT_TRUE(WaitForSingleProcess(procs[index], 60 * 1000));
}
StatsCounter zero_counter(kCounterZero);
@@ -381,4 +380,4 @@
EXPECT_EQ(2, table.GetCounterValue(L"c:bar"));
}
-} // namespace
+} // namespace base
diff --git a/base/trace_event.cc b/base/trace_event.cc
index 2aa9b6f..9b10f9e 100644
--- a/base/trace_event.cc
+++ b/base/trace_event.cc
@@ -26,8 +26,8 @@
FILE_PATH_LITERAL("trace_%d.log");
TraceLog::TraceLog() : enabled_(false), log_file_(NULL) {
- ProcessHandle proc = process_util::GetCurrentProcessHandle();
- process_metrics_.reset(process_util::ProcessMetrics::CreateProcessMetrics(proc));
+ base::ProcessHandle proc = base::GetCurrentProcessHandle();
+ process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(proc));
}
TraceLog::~TraceLog() {
@@ -86,7 +86,7 @@
bool TraceLog::OpenLogFile() {
FilePath::StringType pid_filename =
- StringPrintf(kLogFileName, process_util::GetCurrentProcId());
+ StringPrintf(kLogFileName, base::GetCurrentProcId());
FilePath log_file_path;
if (!PathService::Get(base::DIR_EXE, &log_file_path))
return false;
@@ -133,7 +133,7 @@
StringPrintf("{'pid':'0x%lx', 'tid':'0x%lx', 'type':'%s', "
"'name':'%s', 'id':'0x%lx', 'extra':'%s', 'file':'%s', "
"'line_number':'%d', 'usec_begin': %I64d},\r\n",
- process_util::GetCurrentProcId(),
+ base::GetCurrentProcId(),
PlatformThread::CurrentId(),
kEventTypeNames[type],
name.c_str(),
diff --git a/base/trace_event.h b/base/trace_event.h
index fc531ec..131af46 100644
--- a/base/trace_event.h
+++ b/base/trace_event.h
@@ -73,7 +73,7 @@
#define TRACE_EVENT_INSTANT(name, id, extra)
#endif
-namespace process_util {
+namespace base {
class ProcessMetrics;
}
@@ -126,7 +126,7 @@
FILE* log_file_;
Lock file_lock_;
TimeTicks trace_start_time_;
- scoped_ptr<process_util::ProcessMetrics> process_metrics_;
+ scoped_ptr<base::ProcessMetrics> process_metrics_;
RepeatingTimer<TraceLog> timer_;
};
diff --git a/chrome/app/chrome_exe_main.cc b/chrome/app/chrome_exe_main.cc
index a8529e6f..85a3462c2 100644
--- a/chrome/app/chrome_exe_main.cc
+++ b/chrome/app/chrome_exe_main.cc
@@ -21,7 +21,7 @@
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
wchar_t* command_line, int) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
// The exit manager is in charge of calling the dtors of singletons.
base::AtExitManager exit_manager;
diff --git a/chrome/app/result_codes.h b/chrome/app/result_codes.h
index 4acad55..950863e5 100644
--- a/chrome/app/result_codes.h
+++ b/chrome/app/result_codes.h
@@ -20,9 +20,9 @@
class ResultCodes {
public:
enum ExitCode {
- NORMAL_EXIT = process_util::PROCESS_END_NORMAL_TERMINATON,
- TASKMAN_KILL = process_util::PROCESS_END_KILLED_BY_USER,
- HUNG = process_util::PROCESS_END_PROCESS_WAS_HUNG,
+ NORMAL_EXIT = base::PROCESS_END_NORMAL_TERMINATON,
+ TASKMAN_KILL = base::PROCESS_END_KILLED_BY_USER,
+ HUNG = base::PROCESS_END_PROCESS_WAS_HUNG,
INVALID_CMDLINE_URL, // An invalid command line url was given.
SBOX_INIT_FAILED, // The sandbox could not be initialized.
GOOGLE_UPDATE_INIT_FAILED, // The Google Update client stub init failed.
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 30a7fd1..5bbfc65 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -95,7 +95,7 @@
for (PluginProcessHostIterator iter; !iter.Done(); ++iter) {
PluginProcessHost* plugin = const_cast<PluginProcessHost*>(*iter);
DCHECK(plugin->process());
- Process process(plugin->process());
+ base::Process process(plugin->process());
process.ReduceWorkingSet();
}
}
@@ -115,14 +115,14 @@
// We're idle. Release browser and renderer unused pages.
// Handle the Browser.
- Process process(GetCurrentProcess());
+ base::Process process(GetCurrentProcess());
process.ReduceWorkingSet();
// Handle the Renderer(s).
RenderProcessHost::iterator renderer_iter;
for (renderer_iter = RenderProcessHost::begin(); renderer_iter !=
- RenderProcessHost::end(); renderer_iter++) {
- Process process(renderer_iter->second->process());
+ RenderProcessHost::end(); renderer_iter++) {
+ base::Process process = renderer_iter->second->process();
process.ReduceWorkingSet();
}
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index ff9cb3fb..4bf49f68 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -161,7 +161,7 @@
}
// Time to take action. Kill the browser process.
- process_util::KillProcess(process_id, ResultCodes::HUNG, true);
+ base::KillProcess(process_id, ResultCodes::HUNG, true);
remote_window_ = NULL;
return false;
}
@@ -295,7 +295,7 @@
// Retrieve the list of browser processes on start. This list is then used to
// detect zombie renderer process or plugin process.
- class ZombieDetector : public process_util::ProcessFilter {
+ class ZombieDetector : public base::ProcessFilter {
public:
ZombieDetector() {
for (HWND window = NULL;;) {
@@ -337,9 +337,7 @@
};
ZombieDetector zombie_detector;
- process_util::KillProcesses(L"chrome.exe",
- ResultCodes::HUNG,
- &zombie_detector);
+ base::KillProcesses(L"chrome.exe", ResultCodes::HUNG, &zombie_detector);
}
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index f048c7a..6aba314 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -239,7 +239,7 @@
uninstall_cmd.append(installer_util::switches::kForceUninstall);
uninstall_cmd.append(L" --");
uninstall_cmd.append(installer_util::switches::kDoNotRemoveSharedItems);
- process_util::LaunchApp(uninstall_cmd, false, false, NULL);
+ base::LaunchApp(uninstall_cmd, false, false, NULL);
}
return true;
}
@@ -374,7 +374,7 @@
parsed_command_line.command_line_string();
CommandLine::AppendSwitchWithValue(&new_command_line,
switches::kUserDataDir, user_data_dir);
- process_util::LaunchApp(new_command_line, false, false, NULL);
+ base::LaunchApp(new_command_line, false, false, NULL);
}
return ResultCodes::NORMAL_EXIT;
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc
index 3e82aa0b..1c72024 100755
--- a/chrome/browser/first_run.cc
+++ b/chrome/browser/first_run.cc
@@ -206,8 +206,8 @@
bool Upgrade::RelaunchChromeBrowser(const CommandLine& command_line) {
::SetEnvironmentVariable(google_update::kEnvProductVersionKey, NULL);
- return process_util::LaunchApp(command_line.command_line_string(),
- false, false, NULL);
+ return base::LaunchApp(command_line.command_line_string(),
+ false, false, NULL);
}
bool Upgrade::SwapNewChromeExeIfPresent() {
@@ -226,8 +226,8 @@
std::wstring rename_cmd;
if (key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_READ) &&
key.ReadValue(google_update::kRegRenameCmdField, &rename_cmd)) {
- ProcessHandle handle;
- if (process_util::LaunchApp(rename_cmd, true, true, &handle)) {
+ base::ProcessHandle handle;
+ if (base::LaunchApp(rename_cmd, true, true, &handle)) {
DWORD exit_code;
::GetExitCodeProcess(handle, &exit_code);
::CloseHandle(handle);
@@ -267,7 +267,7 @@
// The constructor takes the importer process to watch and then it does a
// message loop blocking wait until the process ends. This object now owns
// the import_process handle.
- explicit ImportProcessRunner(ProcessHandle import_process)
+ explicit ImportProcessRunner(base::ProcessHandle import_process)
: import_process_(import_process),
exit_code_(ResultCodes::NORMAL_EXIT) {
watcher_.StartWatching(import_process, this);
@@ -292,7 +292,7 @@
private:
base::ObjectWatcher watcher_;
- ProcessHandle import_process_;
+ base::ProcessHandle import_process_;
DWORD exit_code_;
};
@@ -309,7 +309,7 @@
// The ctor takes the owner popup window and the process handle of the
// process to kill in case the popup or its owned active popup become
// unresponsive.
- HungImporterMonitor(HWND owner_window, ProcessHandle import_process)
+ HungImporterMonitor(HWND owner_window, base::ProcessHandle import_process)
: owner_window_(owner_window),
import_process_(import_process),
ticker_(kPollHangFrequency) {
@@ -338,7 +338,7 @@
}
HWND owner_window_;
- ProcessHandle import_process_;
+ base::ProcessHandle import_process_;
WorkerThreadTicker ticker_;
DISALLOW_EVIL_CONSTRUCTORS(HungImporterMonitor);
};
@@ -418,8 +418,8 @@
EncodeImportParams(browser, items_to_import, parent_window));
// Time to launch the process that is going to do the import.
- ProcessHandle import_process;
- if (!process_util::LaunchApp(import_cmd, false, false, &import_process))
+ base::ProcessHandle import_process;
+ if (!base::LaunchApp(import_cmd, false, false, &import_process))
return false;
// Activate the importer monitor. It awakes periodically in another thread
diff --git a/chrome/browser/greasemonkey_master.cc b/chrome/browser/greasemonkey_master.cc
index 41a089f..bb9e1a3 100644
--- a/chrome/browser/greasemonkey_master.cc
+++ b/chrome/browser/greasemonkey_master.cc
@@ -49,7 +49,7 @@
// Runs on the master thread.
// Notify the master that new scripts are available.
- void NotifyMaster(SharedMemory* memory);
+ void NotifyMaster(base::SharedMemory* memory);
// Runs on the File thread.
// Scan the script directory for scripts, calling NotifyMaster when done.
@@ -60,7 +60,7 @@
// Runs on the File thread.
// Scan the script directory for scripts, returning either a new SharedMemory
// or NULL on error.
- SharedMemory* GetNewScripts(const FilePath& script_dir);
+ base::SharedMemory* GetNewScripts(const FilePath& script_dir);
// A pointer back to our master.
// May be NULL if DisownMaster() is called.
@@ -85,7 +85,8 @@
script_dir));
}
-void GreasemonkeyMaster::ScriptReloader::NotifyMaster(SharedMemory* memory) {
+void GreasemonkeyMaster::ScriptReloader::NotifyMaster(
+ base::SharedMemory* memory) {
if (!master_) {
// The master went away, so these new scripts aren't useful anymore.
delete memory;
@@ -99,7 +100,7 @@
}
void GreasemonkeyMaster::ScriptReloader::RunScan(const FilePath script_dir) {
- SharedMemory* shared_memory = GetNewScripts(script_dir);
+ base::SharedMemory* shared_memory = GetNewScripts(script_dir);
// Post the new scripts back to the master's message loop.
master_message_loop_->PostTask(FROM_HERE,
@@ -108,7 +109,7 @@
shared_memory));
}
-SharedMemory* GreasemonkeyMaster::ScriptReloader::GetNewScripts(
+base::SharedMemory* GreasemonkeyMaster::ScriptReloader::GetNewScripts(
const FilePath& script_dir) {
std::vector<std::wstring> scripts;
@@ -140,7 +141,7 @@
}
// Create the shared memory object.
- scoped_ptr<SharedMemory> shared_memory(new SharedMemory());
+ scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
if (!shared_memory->Create(std::wstring(), // anonymous
false, // read-only
@@ -179,9 +180,9 @@
script_reloader_->DisownMaster();
}
-void GreasemonkeyMaster::NewScriptsAvailable(SharedMemory* handle) {
+void GreasemonkeyMaster::NewScriptsAvailable(base::SharedMemory* handle) {
// Ensure handle is deleted or released.
- scoped_ptr<SharedMemory> handle_deleter(handle);
+ scoped_ptr<base::SharedMemory> handle_deleter(handle);
if (pending_scan_) {
// While we were scanning, there were further changes. Don't bother
@@ -196,7 +197,7 @@
NotificationService::current()->Notify(NOTIFY_NEW_USER_SCRIPTS,
NotificationService::AllSources(),
- Details<SharedMemory>(handle));
+ Details<base::SharedMemory>(handle));
}
}
diff --git a/chrome/browser/greasemonkey_master.h b/chrome/browser/greasemonkey_master.h
index d46c1d6..9244b805 100644
--- a/chrome/browser/greasemonkey_master.h
+++ b/chrome/browser/greasemonkey_master.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GREASEMONKEY_MASTER_H__
-#define CHROME_BROWSER_GREASEMONKEY_MASTER_H__
+#ifndef CHROME_BROWSER_GREASEMONKEY_MASTER_H_
+#define CHROME_BROWSER_GREASEMONKEY_MASTER_H_
#include "base/directory_watcher.h"
#include "base/process.h"
@@ -24,12 +24,12 @@
~GreasemonkeyMaster();
// Gets the segment of shared memory for the scripts.
- SharedMemory* GetSharedMemory() const {
+ base::SharedMemory* GetSharedMemory() const {
return shared_memory_.get();
}
// Called by the script reloader when new scripts have been loaded.
- void NewScriptsAvailable(SharedMemory* handle);
+ void NewScriptsAvailable(base::SharedMemory* handle);
// Return true if we have any scripts ready.
bool ScriptsReady() const { return shared_memory_.get() != NULL; }
@@ -59,7 +59,7 @@
scoped_refptr<ScriptReloader> script_reloader_;
// Contains the scripts that were found the last time scripts were updated.
- scoped_ptr<SharedMemory> shared_memory_;
+ scoped_ptr<base::SharedMemory> shared_memory_;
// If the script directory is modified while we're rescanning it, we note
// that we're currently mid-scan and then start over again once the scan
@@ -69,4 +69,4 @@
DISALLOW_COPY_AND_ASSIGN(GreasemonkeyMaster);
};
-#endif // CHROME_BROWSER_GREASEMONKEY_MASTER_H__
+#endif // CHROME_BROWSER_GREASEMONKEY_MASTER_H_
diff --git a/chrome/browser/greasemonkey_master_unittest.cc b/chrome/browser/greasemonkey_master_unittest.cc
index 71676d7..17924b5 100644
--- a/chrome/browser/greasemonkey_master_unittest.cc
+++ b/chrome/browser/greasemonkey_master_unittest.cc
@@ -53,7 +53,7 @@
const NotificationDetails& details) {
DCHECK(type == NOTIFY_NEW_USER_SCRIPTS);
- shared_memory_ = Details<SharedMemory>(details).ptr();
+ shared_memory_ = Details<base::SharedMemory>(details).ptr();
if (MessageLoop::current() == &message_loop_)
MessageLoop::current()->Quit();
}
@@ -65,13 +65,13 @@
FilePath script_dir_;
// Updated to the script shared memory when we get notified.
- SharedMemory* shared_memory_;
+ base::SharedMemory* shared_memory_;
};
// Test that we *don't* get spurious notifications.
TEST_F(GreasemonkeyMasterTest, NoScripts) {
// Set shared_memory_ to something non-NULL, so we can check it became NULL.
- shared_memory_ = reinterpret_cast<SharedMemory*>(1);
+ shared_memory_ = reinterpret_cast<base::SharedMemory*>(1);
scoped_refptr<GreasemonkeyMaster> master(
new GreasemonkeyMaster(MessageLoop::current(), script_dir_));
diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc
index afa01a8..fe58ec0 100644
--- a/chrome/browser/memory_details.cc
+++ b/chrome/browser/memory_details.cc
@@ -79,7 +79,7 @@
continue;
PluginProcessInformation info;
- info.pid = process_util::GetProcId(plugin->process());
+ info.pid = base::GetProcId(plugin->process());
if (info.pid != 0) {
info.dll_path = plugin->dll_path();
plugins_.push_back(info);
@@ -129,9 +129,8 @@
// Get Memory Information.
ProcessMemoryInformation info;
info.pid = process_list[index];
- scoped_ptr<process_util::ProcessMetrics> metrics;
- metrics.reset(
- process_util::ProcessMetrics::CreateProcessMetrics(handle));
+ scoped_ptr<base::ProcessMetrics> metrics;
+ metrics.reset(base::ProcessMetrics::CreateProcessMetrics(handle));
metrics->GetCommittedKBytes(&info.committed);
metrics->GetWorkingSetKBytes(&info.working_set);
diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h
index ddd76d1..8f0f03b 100644
--- a/chrome/browser/memory_details.h
+++ b/chrome/browser/memory_details.h
@@ -25,9 +25,9 @@
// The process id.
int pid;
// The working set information.
- process_util::WorkingSetKBytes working_set;
+ base::WorkingSetKBytes working_set;
// The committed bytes.
- process_util::CommittedKBytes committed;
+ base::CommittedKBytes committed;
// The process version
std::wstring version;
// The process product name.
diff --git a/chrome/browser/metrics_service_uitest.cc b/chrome/browser/metrics_service_uitest.cc
index c62642d7..db35f1c5 100644
--- a/chrome/browser/metrics_service_uitest.cc
+++ b/chrome/browser/metrics_service_uitest.cc
@@ -91,7 +91,7 @@
int process_id = 0;
ASSERT_TRUE(tab->GetProcessID(&process_id));
ASSERT_NE(0, process_id);
- process_util::KillProcess(process_id, 0xc0000005, true); // Fake Access Violation.
+ base::KillProcess(process_id, 0xc0000005, true); // Fake Access Violation.
// Give the browser a chance to notice the crashed tab.
Sleep(1000);
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index 2f84e57..0332015 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -433,7 +433,7 @@
} else {
// spawn child process
HANDLE process;
- if (!process_util::LaunchApp(cmd_line, false, false, &process))
+ if (!base::LaunchApp(cmd_line, false, false, &process))
return false;
process_.set_handle(process);
}
@@ -470,7 +470,7 @@
DCHECK(process_.handle());
DCHECK_EQ(object, process_.handle());
- bool did_crash = process_util::DidProcessCrash(object);
+ bool did_crash = base::DidProcessCrash(object);
if (did_crash) {
// Report that this plugin crashed.
diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h
index 7ae7d29..9301254c 100644
--- a/chrome/browser/plugin_process_host.h
+++ b/chrome/browser/plugin_process_host.h
@@ -132,7 +132,7 @@
std::vector<ChannelRequest> sent_requests_;
// The handle to our plugin process.
- Process process_;
+ base::Process process_;
// Used to watch the plugin process handle.
base::ObjectWatcher watcher_;
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 8df4862..26ae627 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -131,7 +131,7 @@
return;
}
- SharedMemory shared_buf(params.emf_data_handle, true);
+ base::SharedMemory shared_buf(params.emf_data_handle, true);
if (!shared_buf.Map(params.data_size)) {
NOTREACHED() << "couldn't map";
owner_.Stop();
diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc
index fb0bf6b5..e8ac2e24 100644
--- a/chrome/browser/printing/printing_layout_uitest.cc
+++ b/chrome/browser/printing/printing_layout_uitest.cc
@@ -567,7 +567,7 @@
scoped_ptr<base::Thread> worker(
new base::Thread("PrintingLayoutTest_worker"));
scoped_refptr<DismissTheWindow> dismiss_task =
- new DismissTheWindow(process_util::GetProcId(process()));
+ new DismissTheWindow(base::GetProcId(process()));
// We need to start the thread to be able to set the timer.
worker->Start();
worker->message_loop()->PostTask(FROM_HERE,
@@ -605,7 +605,7 @@
scoped_ptr<base::Thread> worker(
new base::Thread("PrintingLayoutTest_worker"));
scoped_refptr<DismissTheWindow> dismiss_task =
- new DismissTheWindow(process_util::GetProcId(process()));
+ new DismissTheWindow(base::GetProcId(process()));
// We need to start the thread to be able to set the timer.
worker->Start();
worker->message_loop()->PostTask(FROM_HERE,
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 80d3ea3..fb3508a4 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -652,7 +652,7 @@
return this;
}
-static void BroadcastNewHistoryTable(SharedMemory* table_memory) {
+static void BroadcastNewHistoryTable(base::SharedMemory* table_memory) {
if (!table_memory)
return;
@@ -662,7 +662,7 @@
if (!i->second->channel())
continue;
- SharedMemoryHandle new_table;
+ base::SharedMemoryHandle new_table;
HANDLE process = i->second->process().handle();
if (!process) {
// process can be null if it's started with the --single-process flag.
diff --git a/chrome/browser/render_process_host.cc b/chrome/browser/render_process_host.cc
index d5bba2b..2c659bc 100644
--- a/chrome/browser/render_process_host.cc
+++ b/chrome/browser/render_process_host.cc
@@ -422,7 +422,7 @@
} else {
// spawn child process
HANDLE process;
- if (!process_util::LaunchApp(cmd_line, false, false, &process))
+ if (!base::LaunchApp(cmd_line, false, false, &process))
return false;
process_.set_handle(process);
}
@@ -443,14 +443,10 @@
return true;
}
-HANDLE RenderProcessHost::GetRendererProcessHandle() {
- HANDLE result = process_.handle();
- if (!result) {
- // Renderer process can be null if it's started with the --single-process
- // flag.
- result = GetCurrentProcess();
- }
- return result;
+base::ProcessHandle RenderProcessHost::GetRendererProcessHandle() {
+ if (run_renderer_in_process_)
+ return base::Process::Current().handle();
+ return process_.handle();
}
void RenderProcessHost::InitVisitedLinks() {
@@ -459,7 +455,7 @@
return;
}
- SharedMemoryHandle handle_for_process = NULL;
+ base::SharedMemoryHandle handle_for_process = NULL;
visitedlink_master->ShareToProcess(GetRendererProcessHandle(),
&handle_for_process);
DCHECK(handle_for_process);
@@ -495,8 +491,8 @@
}
void RenderProcessHost::SendGreasemonkeyScriptsUpdate(
- SharedMemory *shared_memory) {
- SharedMemoryHandle handle_for_process = NULL;
+ base::SharedMemory *shared_memory) {
+ base::SharedMemoryHandle handle_for_process = NULL;
shared_memory->ShareToProcess(GetRendererProcessHandle(),
&handle_for_process);
DCHECK(handle_for_process);
@@ -536,12 +532,10 @@
}
bool RenderProcessHost::FastShutdownIfPossible() {
- HANDLE proc = process().handle();
- if (!proc)
- return false;
- // If we're in single process mode, do nothing.
+ if (!process_.handle())
+ return false; // Render process is probably crashed.
if (RenderProcessHost::run_renderer_in_process())
- return false;
+ return false; // Since process mode can't do fast shutdown.
// Test if there's an unload listener
RenderProcessHost::listeners_iterator iter;
@@ -561,9 +555,10 @@
return false;
}
}
- // Otherwise, call TerminateProcess. Using exit code 0 means that UMA won't
- // treat this as a renderer crash.
- ::TerminateProcess(proc, ResultCodes::NORMAL_EXIT);
+
+ // Otherwise, we're allowed to just terminate the process. Using exit code 0
+ // means that UMA won't treat this as a renderer crash.
+ process_.Terminate(ResultCodes::NORMAL_EXIT);
return true;
}
@@ -651,7 +646,7 @@
DCHECK(channel_.get());
DCHECK_EQ(object, process_.handle());
- bool clean_shutdown = !process_util::DidProcessCrash(object);
+ bool clean_shutdown = !base::DidProcessCrash(object);
process_.Close();
@@ -824,7 +819,8 @@
break;
}
case NOTIFY_NEW_USER_SCRIPTS: {
- SharedMemory* shared_memory = Details<SharedMemory>(details).ptr();
+ base::SharedMemory* shared_memory =
+ Details<base::SharedMemory>(details).ptr();
DCHECK(shared_memory);
if (shared_memory) {
SendGreasemonkeyScriptsUpdate(shared_memory);
diff --git a/chrome/browser/render_process_host.h b/chrome/browser/render_process_host.h
index 262710f5..597cc2b3 100644
--- a/chrome/browser/render_process_host.h
+++ b/chrome/browser/render_process_host.h
@@ -102,7 +102,7 @@
return channel_.get();
}
- const Process& process() const {
+ const base::Process& process() const {
return process_;
}
@@ -178,7 +178,7 @@
// to register/unregister visibility.
void WidgetRestored();
void WidgetHidden();
-
+
// Add a word in the spellchecker.
void AddWord(const std::wstring& word);
@@ -194,7 +194,7 @@
// Clipboard messages
void OnClipboardWriteHTML(const std::wstring& markup, const GURL& src_url);
void OnClipboardWriteBookmark(const std::wstring& title, const GURL& url);
- void OnClipboardWriteBitmap(SharedMemoryHandle bitmap, gfx::Size size);
+ void OnClipboardWriteBitmap(base::SharedMemoryHandle bitmap, gfx::Size size);
void OnClipboardIsFormatAvailable(unsigned int format, bool* result);
void OnClipboardReadText(std::wstring* result);
void OnClipboardReadAsciiText(std::string* result);
@@ -210,11 +210,11 @@
void InitGreasemonkeyScripts();
// Sends the renderer process a new set of Greasemonkey scripts.
- void SendGreasemonkeyScriptsUpdate(SharedMemory* shared_memory);
+ void SendGreasemonkeyScriptsUpdate(base::SharedMemory* shared_memory);
// Gets a handle to the renderer process, normalizing the case where we were
// started with --single-process.
- HANDLE GetRendererProcessHandle();
+ base::ProcessHandle GetRendererProcessHandle();
// Callers can reduce the RenderProcess' priority.
// Returns true if the priority is backgrounded; false otherwise.
@@ -237,7 +237,7 @@
scoped_ptr<IPC::SyncChannel> channel_;
// Our renderer process.
- Process process_;
+ base::Process process_;
// Used to watch the renderer process handle.
base::ObjectWatcher watcher_;
diff --git a/chrome/browser/resource_dispatcher_host.cc b/chrome/browser/resource_dispatcher_host.cc
index f990a26..fdaadc3 100644
--- a/chrome/browser/resource_dispatcher_host.cc
+++ b/chrome/browser/resource_dispatcher_host.cc
@@ -121,7 +121,7 @@
read_buffer_.reset(spare_read_buffer_);
spare_read_buffer_ = NULL;
} else {
- read_buffer_.reset(new SharedMemory);
+ read_buffer_.reset(new base::SharedMemory);
if (!read_buffer_->Create(std::wstring(), false, false, kReadBufSize))
return false;
if (!read_buffer_->Map(kReadBufSize))
@@ -142,7 +142,7 @@
return true;
}
- SharedMemoryHandle handle;
+ base::SharedMemoryHandle handle;
if (!read_buffer_->GiveToProcess(render_process_, &handle)) {
// We wrongfully incremented the pending data count. Fake an ACK message
// to fix this. We can't move this call above the WillSendData because
@@ -175,16 +175,18 @@
// When reading, we don't know if we are going to get EOF (0 bytes read), so
// we typically have a buffer that we allocated but did not use. We keep
// this buffer around for the next read as a small optimization.
- static SharedMemory* spare_read_buffer_;
+ static base::SharedMemory* spare_read_buffer_;
- scoped_ptr<SharedMemory> read_buffer_;
+ scoped_ptr<base::SharedMemory> read_buffer_;
ResourceDispatcherHost::Receiver* receiver_;
int render_process_host_id_;
int routing_id_;
HANDLE render_process_;
ResourceDispatcherHost* rdh_;
};
-SharedMemory* ResourceDispatcherHost::AsyncEventHandler::spare_read_buffer_;
+
+base::SharedMemory*
+ ResourceDispatcherHost::AsyncEventHandler::spare_read_buffer_;
// ----------------------------------------------------------------------------
// ResourceDispatcherHost::SyncEventHandler
diff --git a/chrome/browser/resource_dispatcher_host_unittest.cc b/chrome/browser/resource_dispatcher_host_unittest.cc
index 72b837d..7002b41 100644
--- a/chrome/browser/resource_dispatcher_host_unittest.cc
+++ b/chrome/browser/resource_dispatcher_host_unittest.cc
@@ -163,13 +163,13 @@
void* iter = NULL;
int request_id;
ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &request_id));
- SharedMemoryHandle shm_handle;
+ base::SharedMemoryHandle shm_handle;
ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &shm_handle));
int data_len;
ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &data_len));
ASSERT_EQ(reference_data.size(), data_len);
- SharedMemory shared_mem(shm_handle, true); // read only
+ base::SharedMemory shared_mem(shm_handle, true); // read only
shared_mem.Map(data_len);
const char* data = static_cast<char*>(shared_mem.memory());
ASSERT_EQ(0, memcmp(reference_data.c_str(), data, data_len));
diff --git a/chrome/browser/resource_message_filter.cc b/chrome/browser/resource_message_filter.cc
index 24eb9648..d937341 100644
--- a/chrome/browser/resource_message_filter.cc
+++ b/chrome/browser/resource_message_filter.cc
@@ -487,11 +487,11 @@
}
void ResourceMessageFilter::OnDuplicateSection(
- SharedMemoryHandle renderer_handle,
- SharedMemoryHandle* browser_handle) {
+ base::SharedMemoryHandle renderer_handle,
+ base::SharedMemoryHandle* browser_handle) {
// Duplicate the handle in this process right now so the memory is kept alive
// (even if it is not mapped)
- SharedMemory shared_buf(renderer_handle, true, render_handle_);
+ base::SharedMemory shared_buf(renderer_handle, true, render_handle_);
shared_buf.GiveToProcess(GetCurrentProcess(), browser_handle);
}
diff --git a/chrome/browser/resource_message_filter.h b/chrome/browser/resource_message_filter.h
index 1b068e4..4630cdb 100644
--- a/chrome/browser/resource_message_filter.h
+++ b/chrome/browser/resource_message_filter.h
@@ -136,8 +136,8 @@
void OnGetPreferredExtensionForMimeType(const std::string& mime_type,
std::wstring* ext);
void OnGetCPBrowsingContext(uint32* context);
- void OnDuplicateSection(SharedMemoryHandle renderer_handle,
- SharedMemoryHandle* browser_handle);
+ void OnDuplicateSection(base::SharedMemoryHandle renderer_handle,
+ base::SharedMemoryHandle* browser_handle);
void OnResourceTypeStats(const CacheManager::ResourceTypeStats& stats);
// A javascript code requested to print the current page. This is done in two
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
index b4ae5ea7..41b8f9c 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -1006,9 +1006,9 @@
EXPECT_TRUE(database->Init(filename, NULL));
Time before_time = Time::Now();
- ProcessHandle handle = Process::Current().handle();
- scoped_ptr<process_util::ProcessMetrics> metric(
- process_util::ProcessMetrics::CreateProcessMetrics(handle));
+ base::ProcessHandle handle = base::Process::Current().handle();
+ scoped_ptr<base::ProcessMetrics> metric(
+ base::ProcessMetrics::CreateProcessMetrics(handle));
#if defined(OS_WIN) || defined(OS_LINUX)
CHECK(metric->GetIOCounters(&before));
#endif
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc
index fb55942..b1994dad 100644
--- a/chrome/browser/task_manager.cc
+++ b/chrome/browser/task_manager.cc
@@ -96,7 +96,7 @@
ResourceList* group = group_map_[resource->GetProcess()];
DCHECK(group && !group->empty());
bool first_in_group = ((*group)[0] == resource);
- process_util::ProcessMetrics* process_metrics = NULL;
+ base::ProcessMetrics* process_metrics = NULL;
if (first_in_group) {
MetricsMap::iterator iter = metrics_map_.find(resource->GetProcess());
DCHECK(iter != metrics_map_.end());
@@ -148,7 +148,7 @@
case IDS_TASK_MANAGER_PROCESS_ID_COLUMN:
if (!first_in_group)
return std::wstring();
- return IntToWString(process_util::GetProcId(resource->GetProcess()));
+ return IntToWString(base::GetProcId(resource->GetProcess()));
case kGoatsTeleportedColumn: // Goats Teleported.
goats_teleported_ += rand();
@@ -175,23 +175,23 @@
}
size_t TaskManagerTableModel::GetPrivateMemory(
- process_util::ProcessMetrics* process_metrics) {
+ base::ProcessMetrics* process_metrics) {
return process_metrics->GetPrivateBytes() / 1024;
}
size_t TaskManagerTableModel::GetSharedMemory(
- process_util::ProcessMetrics* process_metrics) {
- process_util::WorkingSetKBytes ws_usage;
+ base::ProcessMetrics* process_metrics) {
+ base::WorkingSetKBytes ws_usage;
process_metrics->GetWorkingSetKBytes(&ws_usage);
return ws_usage.shared;
}
size_t TaskManagerTableModel::GetPhysicalMemory(
- process_util::ProcessMetrics* process_metrics) {
+ base::ProcessMetrics* process_metrics) {
// Memory = working_set.private + working_set.shareable.
// We exclude the shared memory.
size_t total_kbytes = process_metrics->GetWorkingSetSize() / 1024;
- process_util::WorkingSetKBytes ws_usage;
+ base::WorkingSetKBytes ws_usage;
process_metrics->GetWorkingSetKBytes(&ws_usage);
total_kbytes -= ws_usage.shared;
return total_kbytes;
@@ -204,7 +204,7 @@
const wchar_t* counter = table->GetRowName(col_id);
if (counter != NULL && counter[0] != '\0') {
return table->GetCounterValue(counter,
- process_util::GetProcId(resource->GetProcess()));
+ base::GetProcId(resource->GetProcess()));
} else {
NOTREACHED() << "Invalid column.";
}
@@ -344,8 +344,8 @@
new_entry_index = static_cast<int>(iter - resources_.begin());
resources_.insert(++iter, resource);
}
- process_util::ProcessMetrics* pm =
- process_util::ProcessMetrics::CreateProcessMetrics(process);
+ base::ProcessMetrics* pm =
+ base::ProcessMetrics::CreateProcessMetrics(process);
metrics_map_[process] = pm;
// Notify the table that the contents have changed for it to redraw.
@@ -503,8 +503,8 @@
GetCPUUsage(resources_[row2]));
case IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN: {
- process_util::ProcessMetrics* pm1;
- process_util::ProcessMetrics* pm2;
+ base::ProcessMetrics* pm1;
+ base::ProcessMetrics* pm2;
if (!GetProcessMetricsForRows(row1, row2, &pm1, &pm2))
return 0;
return ValueCompare<size_t>(GetPrivateMemory(pm1),
@@ -512,8 +512,8 @@
}
case IDS_TASK_MANAGER_SHARED_MEM_COLUMN: {
- process_util::ProcessMetrics* pm1;
- process_util::ProcessMetrics* pm2;
+ base::ProcessMetrics* pm1;
+ base::ProcessMetrics* pm2;
if (!GetProcessMetricsForRows(row1, row2, &pm1, &pm2))
return 0;
return ValueCompare<size_t>(GetSharedMemory(pm1),
@@ -521,8 +521,8 @@
}
case IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN: {
- process_util::ProcessMetrics* pm1;
- process_util::ProcessMetrics* pm2;
+ base::ProcessMetrics* pm1;
+ base::ProcessMetrics* pm2;
if (!GetProcessMetricsForRows(row1, row2, &pm1, &pm2))
return 0;
return ValueCompare<size_t>(GetPhysicalMemory(pm1),
@@ -530,8 +530,8 @@
}
case IDS_TASK_MANAGER_PROCESS_ID_COLUMN: {
- int proc1_id = process_util::GetProcId(resources_[row1]->GetProcess());
- int proc2_id = process_util::GetProcId(resources_[row2]->GetProcess());
+ int proc1_id = base::GetProcId(resources_[row1]->GetProcess());
+ int proc2_id = base::GetProcId(resources_[row2]->GetProcess());
return ValueCompare<int>(proc1_id, proc2_id);
}
@@ -632,8 +632,8 @@
bool TaskManagerTableModel::GetProcessMetricsForRows(
int row1, int row2,
- process_util::ProcessMetrics** proc_metrics1,
- process_util::ProcessMetrics** proc_metrics2) {
+ base::ProcessMetrics** proc_metrics1,
+ base::ProcessMetrics** proc_metrics2) {
DCHECK(row1 < static_cast<int>(resources_.size()) &&
row2 < static_cast<int>(resources_.size()));
diff --git a/chrome/browser/task_manager.h b/chrome/browser/task_manager.h
index 26fc67e..3c872fb0 100644
--- a/chrome/browser/task_manager.h
+++ b/chrome/browser/task_manager.h
@@ -36,7 +36,7 @@
class Window;
}
-namespace process_util {
+namespace base {
class ProcessMetrics;
}
@@ -215,7 +215,7 @@
};
typedef std::map<HANDLE, std::vector<TaskManager::Resource*>*> GroupMap;
- typedef std::map<HANDLE, process_util::ProcessMetrics*> MetricsMap;
+ typedef std::map<HANDLE, base::ProcessMetrics*> MetricsMap;
typedef std::map<HANDLE, int> CPUUsageMap;
typedef std::map<TaskManager::Resource*, int64> ResourceValueMap;
typedef std::vector<TaskManager::Resource*> ResourceList;
@@ -254,15 +254,15 @@
// Retrieves the private memory (in KB) that should be displayed from the
// passed |process_metrics|.
- size_t GetPrivateMemory(process_util::ProcessMetrics* process_metrics);
+ size_t GetPrivateMemory(base::ProcessMetrics* process_metrics);
// Returns the shared memory (in KB) that should be displayed from the passed
// |process_metrics|.
- size_t GetSharedMemory(process_util::ProcessMetrics* process_metrics);
+ size_t GetSharedMemory(base::ProcessMetrics* process_metrics);
// Returns the pysical memory (in KB) that should be displayed from the passed
// |process_metrics|.
- size_t GetPhysicalMemory(process_util::ProcessMetrics* process_metrics);
+ size_t GetPhysicalMemory(base::ProcessMetrics* process_metrics);
// Returns the stat value at the column |col_id| that should be displayed from
// the passed |process_metrics|.
@@ -272,8 +272,8 @@
// Returns true if there was a ProcessMetrics available for both rows.
bool GetProcessMetricsForRows(int row1,
int row2,
- process_util::ProcessMetrics** proc_metrics1,
- process_util::ProcessMetrics** proc_metrics2);
+ base::ProcessMetrics** proc_metrics1,
+ base::ProcessMetrics** proc_metrics2);
// The list of providers to the task manager. They are ref counted.
ResourceProviderList providers_;
diff --git a/chrome/browser/task_manager_resource_providers.cc b/chrome/browser/task_manager_resource_providers.cc
index 45c51ebb..ceca70cc 100644
--- a/chrome/browser/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager_resource_providers.cc
@@ -34,7 +34,7 @@
// We cache the process as when the WebContents is closed the process
// becomes NULL and the TaskManager still needs it.
process_ = web_contents_->process()->process().handle();
- pid_ = process_util::GetProcId(process_);
+ pid_ = base::GetProcId(process_);
}
TaskManagerWebContentsResource::~TaskManagerWebContentsResource() {
@@ -236,7 +236,7 @@
: plugin_process_(plugin_proc),
title_(),
network_usage_support_(false) {
- pid_ = process_util::GetProcId(plugin_proc.process());
+ pid_ = base::GetProcId(plugin_proc.process());
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN);
@@ -399,7 +399,7 @@
TaskManagerPluginProcessResource* resource =
new TaskManagerPluginProcessResource(plugin_process_info);
resources_[plugin_process_info] = resource;
- pid_to_resources_[process_util::GetProcId(plugin_process_info.process())] =
+ pid_to_resources_[base::GetProcId(plugin_process_info.process())] =
resource;
task_manager_->AddResource(resource);
}
diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc
index ae63204..ed2c1f44 100644
--- a/chrome/browser/visitedlink_master.cc
+++ b/chrome/browser/visitedlink_master.cc
@@ -258,8 +258,8 @@
return true;
}
-bool VisitedLinkMaster::ShareToProcess(ProcessHandle process,
- SharedMemoryHandle *new_handle) {
+bool VisitedLinkMaster::ShareToProcess(base::ProcessHandle process,
+ base::SharedMemoryHandle *new_handle) {
if (shared_memory_)
return shared_memory_->ShareToProcess(process, new_handle);
@@ -267,7 +267,7 @@
return false;
}
-SharedMemoryHandle VisitedLinkMaster::GetSharedMemoryHandle() {
+base::SharedMemoryHandle VisitedLinkMaster::GetSharedMemoryHandle() {
return shared_memory_->handle();
}
@@ -674,7 +674,7 @@
int32 alloc_size = num_entries * sizeof(Fingerprint) + sizeof(SharedHeader);
// Create the shared memory object.
- shared_memory_ = new SharedMemory();
+ shared_memory_ = new base::SharedMemory();
if (!shared_memory_)
return false;
@@ -712,7 +712,7 @@
}
bool VisitedLinkMaster::BeginReplaceURLTable(int32 num_entries) {
- SharedMemory *old_shared_memory = shared_memory_;
+ base::SharedMemory *old_shared_memory = shared_memory_;
Fingerprint* old_hash_table = hash_table_;
int32 old_table_length = table_length_;
if (!CreateURLTable(num_entries, true)) {
@@ -771,7 +771,7 @@
DebugValidate();
#endif
- SharedMemory* old_shared_memory = shared_memory_;
+ base::SharedMemory* old_shared_memory = shared_memory_;
Fingerprint* old_hash_table = hash_table_;
int32 old_table_length = table_length_;
if (!BeginReplaceURLTable(new_size))
@@ -870,7 +870,7 @@
// We are responsible for freeing it AFTER it has been replaced if
// replacement succeeds.
- SharedMemory* old_shared_memory = shared_memory_;
+ base::SharedMemory* old_shared_memory = shared_memory_;
int new_table_size = NewTableSizeForCount(
static_cast<int>(fingerprints.size()));
diff --git a/chrome/browser/visitedlink_master.h b/chrome/browser/visitedlink_master.h
index 56923a7..8c0af4b 100644
--- a/chrome/browser/visitedlink_master.h
+++ b/chrome/browser/visitedlink_master.h
@@ -27,7 +27,7 @@
// operations are pending on another thread.
class VisitedLinkMaster : public VisitedLinkCommon {
public:
- typedef void (PostNewTableEvent)(SharedMemory*);
+ typedef void (PostNewTableEvent)(base::SharedMemory*);
// The |file_thread| may be NULL, in which case write operations will be
// synchronous.
@@ -65,14 +65,15 @@
// Duplicates the handle to the shared memory to another process.
// Returns true on success.
- bool ShareToProcess(ProcessHandle process, SharedMemoryHandle *new_handle);
+ bool ShareToProcess(base::ProcessHandle process,
+ base::SharedMemoryHandle *new_handle);
// returns the name of the shared memory object that slaves can use to map
// the data
std::wstring GetSharedMemoryName() const;
// Returns the handle to the shared memory
- SharedMemoryHandle GetSharedMemoryHandle();
+ base::SharedMemoryHandle GetSharedMemoryHandle();
// Adds a URL to the table.
void AddURL(const GURL& url);
@@ -329,7 +330,7 @@
HANDLE file_;
// Shared memory consists of a SharedHeader followed by the table.
- SharedMemory *shared_memory_;
+ base::SharedMemory *shared_memory_;
// When we generate new tables, we increment the serial number of the
// shared memory object.
diff --git a/chrome/browser/visitedlink_perftest.cc b/chrome/browser/visitedlink_perftest.cc
index 0f02a5a..38fe56d 100644
--- a/chrome/browser/visitedlink_perftest.cc
+++ b/chrome/browser/visitedlink_perftest.cc
@@ -31,7 +31,7 @@
// we have no slaves, so this broadcase is a NOP
VisitedLinkMaster::PostNewTableEvent DummyBroadcastNewTableEvent;
-void DummyBroadcastNewTableEvent(SharedMemory *table) {
+void DummyBroadcastNewTableEvent(base::SharedMemory *table) {
}
// Call at the beginning of the test to retrieve the database name and to
diff --git a/chrome/browser/visitedlink_unittest.cc b/chrome/browser/visitedlink_unittest.cc
index 7f082b7..86c2a24 100644
--- a/chrome/browser/visitedlink_unittest.cc
+++ b/chrome/browser/visitedlink_unittest.cc
@@ -33,11 +33,11 @@
std::vector<VisitedLinkSlave*> g_slaves;
VisitedLinkMaster::PostNewTableEvent SynchronousBroadcastNewTableEvent;
-void SynchronousBroadcastNewTableEvent(SharedMemory* table) {
+void SynchronousBroadcastNewTableEvent(base::SharedMemory* table) {
if (table) {
for (std::vector<VisitedLinkSlave>::size_type i = 0;
i < (int)g_slaves.size(); i++) {
- SharedMemoryHandle new_handle = NULL;
+ base::SharedMemoryHandle new_handle = NULL;
table->ShareToProcess(GetCurrentProcess(), &new_handle);
g_slaves[i]->Init(new_handle);
}
@@ -102,7 +102,7 @@
// Create a slave database.
VisitedLinkSlave slave;
- SharedMemoryHandle new_handle = NULL;
+ base::SharedMemoryHandle new_handle = NULL;
master_->ShareToProcess(GetCurrentProcess(), &new_handle);
bool success = slave.Init(new_handle);
ASSERT_TRUE(success);
@@ -239,7 +239,7 @@
{
VisitedLinkSlave slave;
- SharedMemoryHandle new_handle = NULL;
+ base::SharedMemoryHandle new_handle = NULL;
master_->ShareToProcess(GetCurrentProcess(), &new_handle);
ASSERT_TRUE(slave.Init(new_handle));
g_slaves.push_back(&slave);
@@ -287,7 +287,7 @@
// ...and a slave
VisitedLinkSlave slave;
- SharedMemoryHandle new_handle = NULL;
+ base::SharedMemoryHandle new_handle = NULL;
master_->ShareToProcess(GetCurrentProcess(), &new_handle);
bool success = slave.Init(new_handle);
ASSERT_TRUE(success);
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc
index 2f2fd39..dda65e1 100644
--- a/chrome/browser/web_contents.cc
+++ b/chrome/browser/web_contents.cc
@@ -866,8 +866,8 @@
if (controller()) {
NavigationEntry* entry = controller()->GetActiveEntry();
if (entry) {
- scoped_ptr<process_util::ProcessMetrics> metrics(
- process_util::ProcessMetrics::CreateProcessMetrics(
+ scoped_ptr<base::ProcessMetrics> metrics(
+ base::ProcessMetrics::CreateProcessMetrics(
process()->process().handle()));
TimeDelta elapsed = TimeTicks::Now() - current_load_start_;
diff --git a/chrome/common/chrome_process_filter.h b/chrome/common/chrome_process_filter.h
index 513e687..b082d916 100644
--- a/chrome/common/chrome_process_filter.h
+++ b/chrome/common/chrome_process_filter.h
@@ -9,7 +9,7 @@
// Filter all chrome browser processes that run with the same user data
// directory.
-class BrowserProcessFilter : public process_util::ProcessFilter {
+class BrowserProcessFilter : public base::ProcessFilter {
public:
// Create the filter for the given user_data_dir.
// If user_data_dir is an empty string, will use the PathService
diff --git a/chrome/common/ipc_tests.cc b/chrome/common/ipc_tests.cc
index 3b73de92..251e970 100644
--- a/chrome/common/ipc_tests.cc
+++ b/chrome/common/ipc_tests.cc
@@ -377,14 +377,14 @@
CommandLine::AppendSwitch(&cl, switches::kDebugOnStart);
}
HANDLE process = NULL;
- if (!process_util::LaunchApp(cl, false, true, &process))
+ if (!base::LaunchApp(cl, false, true, &process))
return NULL;
return process;
}
int main(int argc, char** argv) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
// Some tests may use base::Singleton<>, thus we need to instanciate
// the AtExitManager or else we will leak objects.
base::AtExitManager at_exit_manager;
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index f2676fd..0c009a56 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -129,8 +129,8 @@
gfx::Rect /* clip_rect */,
std::vector<gfx::Rect> /* cutout_rects */,
bool /* visible */,
- SharedMemoryHandle /* windowless_buffer */,
- SharedMemoryHandle /* background_buffer */)
+ base::SharedMemoryHandle /* windowless_buffer */,
+ base::SharedMemoryHandle /* background_buffer */)
IPC_SYNC_MESSAGE_ROUTED0_0(PluginMsg_SetFocus)
diff --git a/chrome/common/process_watcher.cc b/chrome/common/process_watcher.cc
index c189c2d..b43e2db 100644
--- a/chrome/common/process_watcher.cc
+++ b/chrome/common/process_watcher.cc
@@ -17,7 +17,7 @@
class TimerExpiredTask : public Task, public base::ObjectWatcher::Delegate {
public:
- explicit TimerExpiredTask(ProcessHandle process) : process_(process) {
+ explicit TimerExpiredTask(base::ProcessHandle process) : process_(process) {
watcher_.StartWatching(process_, this);
}
@@ -68,7 +68,7 @@
}
// The process that we are watching.
- ProcessHandle process_;
+ base::ProcessHandle process_;
base::ObjectWatcher watcher_;
@@ -78,7 +78,7 @@
} // namespace
// static
-void ProcessWatcher::EnsureProcessTerminated(ProcessHandle process) {
+void ProcessWatcher::EnsureProcessTerminated(base::ProcessHandle process) {
DCHECK(process != GetCurrentProcess());
// If already signaled, then we are done!
diff --git a/chrome/common/process_watcher.h b/chrome/common/process_watcher.h
index caf1c9c..0f6cb6b 100644
--- a/chrome/common/process_watcher.h
+++ b/chrome/common/process_watcher.h
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_PROCESS_WATCHER_H__
-#define CHROME_COMMON_PROCESS_WATCHER_H__
+#ifndef CHROME_COMMON_PROCESS_WATCHER_H_
+#define CHROME_COMMON_PROCESS_WATCHER_H_
+#include "base/basictypes.h"
#include "base/process_util.h"
class ProcessWatcher {
@@ -22,14 +23,14 @@
// NOTE: The process handle must have been opened with the PROCESS_TERMINATE
// and SYNCHRONIZE permissions.
//
- static void EnsureProcessTerminated(ProcessHandle process_handle);
+ static void EnsureProcessTerminated(base::ProcessHandle process_handle);
private:
// Do not instantiate this class.
ProcessWatcher();
- DISALLOW_EVIL_CONSTRUCTORS(ProcessWatcher);
+ DISALLOW_COPY_AND_ASSIGN(ProcessWatcher);
};
-#endif // CHROME_COMMON_PROCESS_WATCHER_H__
+#endif // CHROME_COMMON_PROCESS_WATCHER_H_
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index d50faa60..7c6f2c1 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -189,7 +189,7 @@
struct ViewHostMsg_PaintRect_Params {
// The bitmap to be painted into the rect given by bitmap_rect. Valid only
// in the context of the renderer process.
- SharedMemoryHandle bitmap;
+ base::SharedMemoryHandle bitmap;
// The position and size of the bitmap.
gfx::Rect bitmap_rect;
@@ -223,7 +223,7 @@
struct ViewHostMsg_ScrollRect_Params {
// The bitmap to be painted into the rect exposed by scrolling. This handle
// is valid only in the context of the renderer process.
- SharedMemoryHandle bitmap;
+ base::SharedMemoryHandle bitmap;
// The position and size of the bitmap.
gfx::Rect bitmap_rect;
@@ -367,7 +367,7 @@
struct ViewHostMsg_DidPrintPage_Params {
// A shared memory handle to the EMF data. This data can be quite large so a
// memory map needs to be used.
- SharedMemoryHandle emf_data_handle;
+ base::SharedMemoryHandle emf_data_handle;
// Size of the EMF data.
unsigned data_size;
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index a4098a0..02e910d8 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -156,12 +156,12 @@
// History system notification that the visited link database has been
// replaced. It has one SharedMemoryHandle argument consisting of the table
// handle. This handle is valid in the context of the renderer
- IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_NewTable, SharedMemoryHandle)
+ IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_NewTable, base::SharedMemoryHandle)
// Notification that the Greasemonkey scripts have been updated. It has one
// SharedMemoryHandle argument consisting of the pickled script data. This
// handle is valid in the context of the renderer.
- IPC_MESSAGE_CONTROL1(ViewMsg_Greasemonkey_NewScripts, SharedMemoryHandle)
+ IPC_MESSAGE_CONTROL1(ViewMsg_Greasemonkey_NewScripts, base::SharedMemoryHandle)
// Sent when the user wants to search for a word on the page (find in page).
// Request parameters are passed in as a FindInPageMsg_Request struct.
@@ -187,7 +187,7 @@
// already be mapped into the process that receives this message.
IPC_MESSAGE_ROUTED3(ViewMsg_Resource_DataReceived,
int /* request_id */,
- SharedMemoryHandle /* data */,
+ base::SharedMemoryHandle /* data */,
int /* data_len */)
// Sent when the request has been completed.
@@ -1056,8 +1056,8 @@
// Duplicates a shared memory handle from the renderer to the browser. Then
// the renderer can flush the handle.
IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_DuplicateSection,
- SharedMemoryHandle /* renderer handle */,
- SharedMemoryHandle /* browser handle */)
+ base::SharedMemoryHandle /* renderer handle */,
+ base::SharedMemoryHandle /* browser handle */)
// Provide the browser process with information about the WebCore resource
// cache.
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 04693ab7..d662fd9 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -334,7 +334,7 @@
}
void ResourceDispatcher::OnReceivedData(int request_id,
- SharedMemoryHandle shm_handle,
+ base::SharedMemoryHandle shm_handle,
int data_len) {
// Acknowlegde the reception of this data.
IPC::Message::Sender* sender = message_sender();
@@ -343,7 +343,7 @@
new ViewHostMsg_DataReceived_ACK(MSG_ROUTING_NONE, request_id));
DCHECK((shm_handle && data_len > 0) || (!shm_handle && !data_len));
- SharedMemory shared_mem(shm_handle, true); // read only
+ base::SharedMemory shared_mem(shm_handle, true); // read only
PendingRequestList::iterator it = pending_requests_.find(request_id);
if (it == pending_requests_.end()) {
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index b4c4037fa..5fa4bc5c 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -101,7 +101,8 @@
void OnUploadProgress(int request_id, int64 position, int64 size);
void OnReceivedResponse(int request_id, const ViewMsg_Resource_ResponseHead&);
void OnReceivedRedirect(int request_id, const GURL& new_url);
- void OnReceivedData(int request_id, SharedMemoryHandle data, int data_len);
+ void OnReceivedData(int request_id, base::SharedMemoryHandle data,
+ int data_len);
void OnRequestComplete(int request_id, const URLRequestStatus& status);
// Dispatch the message to one of the message response handlers.
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index a75e556..5fefdcd 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -102,13 +102,13 @@
dispatcher_->OnReceivedResponse(request_id, response);
// received data message with the test contents
- SharedMemory shared_mem;
+ base::SharedMemory shared_mem;
EXPECT_TRUE(shared_mem.Create(std::wstring(),
false, false, test_page_contents_len));
EXPECT_TRUE(shared_mem.Map(test_page_contents_len));
char* put_data_here = static_cast<char*>(shared_mem.memory());
memcpy(put_data_here, test_page_contents, test_page_contents_len);
- SharedMemoryHandle dup_handle;
+ base::SharedMemoryHandle dup_handle;
EXPECT_TRUE(shared_mem.GiveToProcess(GetCurrentProcess(), &dup_handle));
dispatcher_->OnReceivedData(request_id, dup_handle, test_page_contents_len);
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index fe62e67..4bf58568 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -52,8 +52,8 @@
window = FindWindowEx(NULL, window, wnd_class.c_str(), NULL);
if (!SendMessageTimeout(tmpWnd, WM_CLOSE, 0, 0, SMTO_BLOCK, 3000, NULL) &&
(GetLastError() == ERROR_TIMEOUT)) {
- process_util::CleanupProcesses(installer_util::kChromeExe, 0,
- ResultCodes::HUNG, NULL);
+ base::CleanupProcesses(installer_util::kChromeExe, 0,
+ ResultCodes::HUNG, NULL);
return;
}
}
@@ -61,8 +61,8 @@
// If asking politely didn't work, wait for 15 seconds and then kill all
// chrome.exe. This check is just in case Chrome is ignoring WM_CLOSE messages.
- process_util::CleanupProcesses(installer_util::kChromeExe, 15000,
- ResultCodes::HUNG, NULL);
+ base::CleanupProcesses(installer_util::kChromeExe, 15000,
+ ResultCodes::HUNG, NULL);
}
// This method deletes Chrome shortcut folder from Windows Start menu. It
diff --git a/chrome/installer/util/helper.cc b/chrome/installer/util/helper.cc
index 3d86c8d..b7dd3c6 100644
--- a/chrome/installer/util/helper.cc
+++ b/chrome/installer/util/helper.cc
@@ -39,7 +39,7 @@
chrome_exe.append(installer::GetChromeInstallPath(system_install));
file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe);
chrome_exe.append(L"\"");
- return process_util::LaunchApp(chrome_exe, false, false, NULL);
+ return base::LaunchApp(chrome_exe, false, false, NULL);
}
bool installer::LaunchChromeAndWaitForResult(bool system_install,
diff --git a/chrome/installer/util/run_all_unittests.cc b/chrome/installer/util/run_all_unittests.cc
index 4ab019a..e7c7b37 100644
--- a/chrome/installer/util/run_all_unittests.cc
+++ b/chrome/installer/util/run_all_unittests.cc
@@ -6,6 +6,6 @@
#include "base/test_suite.h"
int main(int argc, char** argv) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
return TestSuite(argc, argv).Run();
}
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 158dc45..91df155 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -226,7 +226,7 @@
size_t size = emf.GetDataSize();
DCHECK(size);
params->size = size;
- SharedMemory shared_buf;
+ base::SharedMemory shared_buf;
CreateSharedBuffer(size, &shared_buf, ¶ms->shared_memory);
// Retrieve a copy of the data.
@@ -239,8 +239,8 @@
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer) {
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer) {
webplugin_->UpdateGeometry(
window_rect, clip_rect, cutout_rects, visible, windowless_buffer,
background_buffer);
@@ -301,8 +301,8 @@
void WebPluginDelegateStub::CreateSharedBuffer(
size_t size,
- SharedMemory* shared_buf,
- SharedMemoryHandle* remote_handle) {
+ base::SharedMemory* shared_buf,
+ base::SharedMemoryHandle* remote_handle) {
if (!shared_buf->Create(std::wstring(), false, false, size)) {
NOTREACHED();
return;
@@ -319,6 +319,7 @@
remote_handle, 0, FALSE,
DUPLICATE_SAME_ACCESS);
DCHECK_NE(result, 0);
+
// If the calling function's shared_buf is on the stack, its destructor will
// close the shared memory buffer handle. This is fine since we already
// duplicated the handle to the renderer process so it will stay "alive".
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index d8fed1fe..8b49991 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -67,8 +67,8 @@
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer);
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer);
void OnGetPluginScriptableObject(int* route_id, void** npobject_ptr);
void OnSendJavaScriptStream(const std::string& url,
const std::wstring& result,
@@ -90,8 +90,8 @@
HANDLE notify_data);
void CreateSharedBuffer(size_t size,
- SharedMemory* shared_buf,
- SharedMemoryHandle* remote_handle);
+ base::SharedMemory* shared_buf,
+ base::SharedMemoryHandle* remote_handle);
int instance_id_;
std::string mime_type_;
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 56beb25c..2cbb3ee 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -279,9 +279,9 @@
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer) {
- gfx::Rect old = delegate_->rect();
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer) {
+ gfx::Rect old = delegate_->rect();
bool moved = delegate_->rect().x() != window_rect.x() ||
delegate_->rect().y() != window_rect.y();
delegate_->UpdateGeometry(window_rect, clip_rect, cutout_rects, visible);
@@ -295,8 +295,8 @@
}
void WebPluginProxy::SetWindowlessBuffer(
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer) {
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer) {
// Convert the shared memory handle to a handle that works in our process,
// and then use that to create an HDC.
ConvertBuffer(windowless_buffer,
@@ -312,7 +312,7 @@
UpdateTransform();
}
-void WebPluginProxy::ConvertBuffer(const SharedMemoryHandle& buffer,
+void WebPluginProxy::ConvertBuffer(const base::SharedMemoryHandle& buffer,
ScopedHandle* shared_section,
ScopedBitmap* bitmap,
ScopedHDC* hdc) {
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 5374d1c3..e6a231d 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -83,8 +83,8 @@
const gfx::Rect& clip_rect,
const std::vector<gfx::Rect>& cutout_rects,
bool visible,
- const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer);
+ const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer);
void CancelDocumentLoad();
@@ -98,12 +98,12 @@
bool Send(IPC::Message* msg);
// Updates the shared memory section where windowless plugins paint.
- void SetWindowlessBuffer(const SharedMemoryHandle& windowless_buffer,
- const SharedMemoryHandle& background_buffer);
+ void SetWindowlessBuffer(const base::SharedMemoryHandle& windowless_buffer,
+ const base::SharedMemoryHandle& background_buffer);
// Converts a shared memory section handle from the renderer process into a
// bitmap and hdc that are mapped to this process.
- void ConvertBuffer(const SharedMemoryHandle& buffer,
+ void ConvertBuffer(const base::SharedMemoryHandle& buffer,
ScopedHandle* shared_section,
ScopedBitmap* bitmap,
ScopedHDC* hdc);
diff --git a/chrome/renderer/greasemonkey_slave.cc b/chrome/renderer/greasemonkey_slave.cc
index 5a4072a..f2de9fb 100644
--- a/chrome/renderer/greasemonkey_slave.cc
+++ b/chrome/renderer/greasemonkey_slave.cc
@@ -113,11 +113,11 @@
GreasemonkeySlave::GreasemonkeySlave() : shared_memory_(NULL) {
}
-bool GreasemonkeySlave::UpdateScripts(SharedMemoryHandle shared_memory) {
+bool GreasemonkeySlave::UpdateScripts(base::SharedMemoryHandle shared_memory) {
scripts_.clear();
- // Create the shared memory object.
- shared_memory_.reset(new SharedMemory(shared_memory, true)); // read-only
+ // Create the shared memory object (read only).
+ shared_memory_.reset(new base::SharedMemory(shared_memory, true));
if (!shared_memory_.get())
return false;
diff --git a/chrome/renderer/greasemonkey_slave.h b/chrome/renderer/greasemonkey_slave.h
index 5be3697..5f80f8b 100644
--- a/chrome/renderer/greasemonkey_slave.h
+++ b/chrome/renderer/greasemonkey_slave.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_RENDERER_GREASEMONKEY_SLAVE_H__
-#define CHROME_RENDERER_GREASEMONKEY_SLAVE_H__
+#ifndef CHROME_RENDERER_GREASEMONKEY_SLAVE_H_
+#define CHROME_RENDERER_GREASEMONKEY_SLAVE_H_
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
@@ -75,7 +75,7 @@
GreasemonkeySlave();
// Update the parsed scripts from shared memory.
- bool UpdateScripts(SharedMemoryHandle shared_memory);
+ bool UpdateScripts(base::SharedMemoryHandle shared_memory);
// Inject the appropriate scripts into a frame based on its URL.
// TODO(aa): Extract a GreasemonkeyFrame interface out of this to improve
@@ -84,7 +84,7 @@
private:
// Shared memory containing raw script data.
- scoped_ptr<SharedMemory> shared_memory_;
+ scoped_ptr<base::SharedMemory> shared_memory_;
// Parsed script data.
std::vector<GreasemonkeyScript> scripts_;
@@ -92,4 +92,4 @@
DISALLOW_COPY_AND_ASSIGN(GreasemonkeySlave);
};
-#endif // CHROME_RENDERER_GREASEMONKEY_SLAVE_H__
+#endif // CHROME_RENDERER_GREASEMONKEY_SLAVE_H_
diff --git a/chrome/renderer/greasemonkey_slave_unittest.cc b/chrome/renderer/greasemonkey_slave_unittest.cc
index 06c48c2..bedbfbf 100644
--- a/chrome/renderer/greasemonkey_slave_unittest.cc
+++ b/chrome/renderer/greasemonkey_slave_unittest.cc
@@ -7,9 +7,6 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
-class GreasemonkeySlaveTest : public testing::Test {
-};
-
TEST(GreasemonkeySlaveTest, EscapeGlob) {
EXPECT_EQ("", GreasemonkeyScript::EscapeGlob(""));
EXPECT_EQ("*", GreasemonkeyScript::EscapeGlob("*"));
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc
index 44a8055..b2b4606 100644
--- a/chrome/renderer/render_process.cc
+++ b/chrome/renderer/render_process.cc
@@ -108,10 +108,10 @@
}
// static
-SharedMemory* RenderProcess::AllocSharedMemory(size_t size) {
+base::SharedMemory* RenderProcess::AllocSharedMemory(size_t size) {
self()->clearer_factory_.RevokeAll();
- SharedMemory* mem = self()->GetSharedMemFromCache(size);
+ base::SharedMemory* mem = self()->GetSharedMemFromCache(size);
if (mem)
return mem;
@@ -122,7 +122,7 @@
size = size / info.dwAllocationGranularity + 1;
size = size * info.dwAllocationGranularity;
- mem = new SharedMemory();
+ mem = new base::SharedMemory();
if (!mem)
return NULL;
if (!mem->Create(L"", false, true, size)) {
@@ -134,7 +134,7 @@
}
// static
-void RenderProcess::FreeSharedMemory(SharedMemory* mem) {
+void RenderProcess::FreeSharedMemory(base::SharedMemory* mem) {
if (self()->PutSharedMemInCache(mem)) {
self()->ScheduleCacheClearer();
return;
@@ -143,14 +143,14 @@
}
// static
-void RenderProcess::DeleteSharedMem(SharedMemory* mem) {
+void RenderProcess::DeleteSharedMem(base::SharedMemory* mem) {
delete mem;
}
-SharedMemory* RenderProcess::GetSharedMemFromCache(size_t size) {
+base::SharedMemory* RenderProcess::GetSharedMemFromCache(size_t size) {
// look for a cached object that is suitable for the requested size.
for (int i = 0; i < arraysize(shared_mem_cache_); ++i) {
- SharedMemory* mem = shared_mem_cache_[i];
+ base::SharedMemory* mem = shared_mem_cache_[i];
if (mem && mem->max_size() >= size) {
shared_mem_cache_[i] = NULL;
return mem;
@@ -159,7 +159,7 @@
return NULL;
}
-bool RenderProcess::PutSharedMemInCache(SharedMemory* mem) {
+bool RenderProcess::PutSharedMemInCache(base::SharedMemory* mem) {
// simple algorithm:
// - look for an empty slot to store mem, or
// - if full, then replace any existing cache entry that is smaller than the
@@ -171,7 +171,7 @@
}
}
for (int i = 0; i < arraysize(shared_mem_cache_); ++i) {
- SharedMemory* cached_mem = shared_mem_cache_[i];
+ base::SharedMemory* cached_mem = shared_mem_cache_[i];
if (cached_mem->max_size() < mem->max_size()) {
shared_mem_cache_[i] = mem;
DeleteSharedMem(cached_mem);
diff --git a/chrome/renderer/render_process.h b/chrome/renderer/render_process.h
index 8fcb186..bdba635 100644
--- a/chrome/renderer/render_process.h
+++ b/chrome/renderer/render_process.h
@@ -30,14 +30,14 @@
// reported in the resulting SharedMemory object will be greater than or
// equal to the requested size. This method returns NULL if unable to
// allocate memory for some reason.
- static SharedMemory* AllocSharedMemory(size_t size);
+ static base::SharedMemory* AllocSharedMemory(size_t size);
// Frees shared memory allocated by AllocSharedMemory. You should only use
// this function to free the SharedMemory object.
- static void FreeSharedMemory(SharedMemory* mem);
+ static void FreeSharedMemory(base::SharedMemory* mem);
// Deletes the shared memory allocated by AllocSharedMemory.
- static void DeleteSharedMem(SharedMemory* mem);
+ static void DeleteSharedMem(base::SharedMemory* mem);
private:
friend class ChildProcessFactory<RenderProcess>;
@@ -54,12 +54,12 @@
// Look in the shared memory cache for a suitable object to reuse. Returns
// NULL if there is none.
- SharedMemory* GetSharedMemFromCache(size_t size);
+ base::SharedMemory* GetSharedMemFromCache(size_t size);
// Maybe put the given shared memory into the shared memory cache. Returns
// true if the SharedMemory object was stored in the cache; otherwise, false
// is returned.
- bool PutSharedMemInCache(SharedMemory* mem);
+ bool PutSharedMemInCache(base::SharedMemory* mem);
void ClearSharedMemCache();
@@ -76,7 +76,7 @@
// A very simplistic and small cache. If an entry in this array is non-null,
// then it points to a SharedMemory object that is available for reuse.
- SharedMemory* shared_mem_cache_[2];
+ base::SharedMemory* shared_mem_cache_[2];
// This factory is used to lazily invoke ClearSharedMemCache.
ScopedRunnableMethodFactory<RenderProcess> clearer_factory_;
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index fd262de..60ac402 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -148,14 +148,15 @@
CoUninitialize();
}
-void RenderThread::OnUpdateVisitedLinks(SharedMemoryHandle table) {
+void RenderThread::OnUpdateVisitedLinks(base::SharedMemoryHandle table) {
DCHECK(table) << "Bad table handle";
visited_link_slave_->Init(table);
}
-void RenderThread::OnUpdateGreasemonkeyScripts(SharedMemoryHandle scripts) {
+void RenderThread::OnUpdateGreasemonkeyScripts(
+ base::SharedMemoryHandle scripts) {
DCHECK(scripts) << "Bad scripts handle";
- greasemonkey_slave_->UpdateScripts(scripts);
+ greasemonkey_slave_->UpdateScripts(scripts);
}
void RenderThread::OnMessageReceived(const IPC::Message& msg) {
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h
index 38fd144..6de92324 100644
--- a/chrome/renderer/render_thread.h
+++ b/chrome/renderer/render_thread.h
@@ -93,8 +93,8 @@
virtual void CleanUp();
private:
- void OnUpdateVisitedLinks(SharedMemoryHandle table);
- void OnUpdateGreasemonkeyScripts(SharedMemoryHandle table);
+ void OnUpdateVisitedLinks(base::SharedMemoryHandle table);
+ void OnUpdateGreasemonkeyScripts(base::SharedMemoryHandle table);
void OnPluginMessage(const std::wstring& dll_path,
const std::vector<uint8>& data);
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 30cd633..7e812a45 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -581,7 +581,7 @@
page_params.page_number = params.page_number;
page_params.document_cookie = params.params.document_cookie;
page_params.actual_shrink = shrink;
- SharedMemory shared_buf;
+ base::SharedMemory shared_buf;
// http://msdn2.microsoft.com/en-us/library/ms535522.aspx
// Windows 2000/XP: When a page in a spooled file exceeds approximately 350
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index a78df39d..7ee0f8f4 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -38,7 +38,6 @@
class DebugMessageHandler;
class GURL;
-class SharedMemory;
class SkBitmap;
struct ThumbnailScore;
class WebError;
@@ -48,7 +47,7 @@
enum WebRequestCachePolicy;
namespace webkit_glue {
- struct FileUploadData;
+struct FileUploadData;
}
// We need to prevent a page from trying to create infinite popups. It is not
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index ab1a270..7f0f7ca8 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -354,7 +354,8 @@
webwidget_->SetFocus(false);
}
-void RenderWidget::PaintRect(const gfx::Rect& rect, SharedMemory* paint_buf) {
+void RenderWidget::PaintRect(const gfx::Rect& rect,
+ base::SharedMemory* paint_buf) {
gfx::PlatformCanvasWin canvas(rect.width(), rect.height(), true,
paint_buf->handle());
// Bring the canvas into the coordinate system of the paint rect
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index f597dff..f69d77e 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -101,7 +101,7 @@
// Paints the given rectangular region of the WebWidget into paint_buf (a
// shared memory segment returned by AllocPaintBuf). The caller must ensure
// that the given rect fits within the bounds of the WebWidget.
- void PaintRect(const gfx::Rect& rect, SharedMemory* paint_buf);
+ void PaintRect(const gfx::Rect& rect, base::SharedMemory* paint_buf);
// Get the size of the paint buffer for the given rectangle, rounding up to
// the allocation granularity of the system.
@@ -204,8 +204,8 @@
// Shared memory handles that are currently in use to transfer an image to
// the browser.
- SharedMemory* current_paint_buf_;
- SharedMemory* current_scroll_buf_;
+ base::SharedMemory* current_paint_buf_;
+ base::SharedMemory* current_scroll_buf_;
// The smallest bounding rectangle that needs to be re-painted. This is non-
// empty if a paint event is pending.
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index 1cc689f..0d958cfa 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -95,10 +95,10 @@
shared_buf_->Unmap();
Clipboard::ObjectMapParam param1, param2;
- SharedMemoryHandle smh = shared_buf_->handle();
+ base::SharedMemoryHandle smh = shared_buf_->handle();
const char* shared_handle = reinterpret_cast<const char*>(&smh);
- for (size_t i = 0; i < sizeof SharedMemoryHandle; i++)
+ for (size_t i = 0; i < sizeof base::SharedMemoryHandle; i++)
param1.push_back(shared_handle[i]);
const char* size_data = reinterpret_cast<const char*>(&size);
diff --git a/chrome/renderer/visitedlink_slave.cc b/chrome/renderer/visitedlink_slave.cc
index 3c928f9..1e6092bb 100644
--- a/chrome/renderer/visitedlink_slave.cc
+++ b/chrome/renderer/visitedlink_slave.cc
@@ -15,14 +15,14 @@
// This function's job is to initialize the table with the given
// shared memory handle. This memory is mappend into the process.
-bool VisitedLinkSlave::Init(SharedMemoryHandle shared_memory) {
+bool VisitedLinkSlave::Init(base::SharedMemoryHandle shared_memory) {
// since this function may be called again to change the table, we may need
// to free old objects
FreeTable();
DCHECK(shared_memory_ == NULL && hash_table_ == NULL);
// create the shared memory object
- shared_memory_ = new SharedMemory(shared_memory, true);
+ shared_memory_ = new base::SharedMemory(shared_memory, true);
if (!shared_memory_)
return false;
diff --git a/chrome/renderer/visitedlink_slave.h b/chrome/renderer/visitedlink_slave.h
index ff5ff64..39752fd0 100644
--- a/chrome/renderer/visitedlink_slave.h
+++ b/chrome/renderer/visitedlink_slave.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_WIN_RENDERER_VISITEDLINK_SLAVE_H__
-#define CHROME_WIN_RENDERER_VISITEDLINK_SLAVE_H__
+#ifndef CHROME_RENDERER_VISITEDLINK_SLAVE_H_
+#define CHROME_RENDERER_VISITEDLINK_SLAVE_H_
#include "base/shared_memory.h"
#include "chrome/common/visitedlink_common.h"
@@ -20,15 +20,15 @@
// It can also be called again at any time to update the table that we're
// using. The handle should be the handle generated by the VisitedLinkMaster.
// Returns true on success.
- bool Init(SharedMemoryHandle shared_memory);
+ bool Init(base::SharedMemoryHandle shared_memory);
private:
void FreeTable();
// shared memory consists of a SharedHeader followed by the table
- SharedMemory* shared_memory_;
+ base::SharedMemory* shared_memory_;
- DISALLOW_EVIL_CONSTRUCTORS(VisitedLinkSlave);
+ DISALLOW_COPY_AND_ASSIGN(VisitedLinkSlave);
};
-#endif // WIN_RENDERER_VISITEDLINK_SLAVE_H__
+#endif // CHROME_RENDERER_VISITEDLINK_SLAVE_H_
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index efceffb..13b06a37 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -397,10 +397,10 @@
}
bool WebPluginDelegateProxy::CreateBitmap(
- scoped_ptr<SharedMemory>* memory,
+ scoped_ptr<base::SharedMemory>* memory,
scoped_ptr<gfx::PlatformCanvasWin>* canvas) {
size_t size = GetPaintBufSize(plugin_rect_);
- scoped_ptr<SharedMemory> new_shared_memory(new SharedMemory());
+ scoped_ptr<base::SharedMemory> new_shared_memory(new base::SharedMemory());
if (!new_shared_memory->Create(L"", false, true, size))
return false;
@@ -515,7 +515,7 @@
PluginMsg_PrintResponse_Params params = { 0 };
Send(new PluginMsg_Print(instance_id_, ¶ms));
- SharedMemory memory(params.shared_memory, true);
+ base::SharedMemory memory(params.shared_memory, true);
if (!memory.Map(params.size)) {
NOTREACHED();
return;
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index b401baa..a11d083 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -144,7 +144,7 @@
void ResetWindowlessBitmaps();
// Creates a shared memory section and canvas.
- bool CreateBitmap(scoped_ptr<SharedMemory>* memory,
+ bool CreateBitmap(scoped_ptr<base::SharedMemory>* memory,
scoped_ptr<gfx::PlatformCanvasWin>* canvas);
RenderView* render_view_;
@@ -182,11 +182,11 @@
// store when we get an invalidate from it. The background bitmap is used
// for transparent plugins, as they need the backgroud data during painting.
bool transparent_;
- scoped_ptr<SharedMemory> backing_store_;
+ scoped_ptr<base::SharedMemory> backing_store_;
scoped_ptr<gfx::PlatformCanvasWin> backing_store_canvas_;
- scoped_ptr<SharedMemory> transport_store_;
+ scoped_ptr<base::SharedMemory> transport_store_;
scoped_ptr<gfx::PlatformCanvasWin> transport_store_canvas_;
- scoped_ptr<SharedMemory> background_store_;
+ scoped_ptr<base::SharedMemory> background_store_;
scoped_ptr<gfx::PlatformCanvasWin> background_store_canvas_;
DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateProxy);
diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc
index d31c1e5..fc68ede0 100644
--- a/chrome/test/memory_test/memory_test.cc
+++ b/chrome/test/memory_test/memory_test.cc
@@ -266,7 +266,7 @@
void PrintIOPerfInfo(const wchar_t* test_name) {
printf("\n");
BrowserProcessFilter chrome_filter(user_data_dir_);
- process_util::NamedProcessIterator
+ base::NamedProcessIterator
chrome_process_itr(chrome::kBrowserProcessExecutableName,
&chrome_filter);
@@ -281,10 +281,10 @@
continue;
}
- scoped_ptr<process_util::ProcessMetrics> process_metrics;
+ scoped_ptr<base::ProcessMetrics> process_metrics;
IO_COUNTERS io_counters;
process_metrics.reset(
- process_util::ProcessMetrics::CreateProcessMetrics(process_handle));
+ base::ProcessMetrics::CreateProcessMetrics(process_handle));
ZeroMemory(&io_counters, sizeof(io_counters));
if (process_metrics.get()->GetIOCounters(&io_counters)) {
@@ -318,7 +318,7 @@
void PrintMemoryUsageInfo(const wchar_t* test_name) {
printf("\n");
BrowserProcessFilter chrome_filter(user_data_dir_);
- process_util::NamedProcessIterator
+ base::NamedProcessIterator
chrome_process_itr(chrome::kBrowserProcessExecutableName,
&chrome_filter);
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc
index d4f0f11..d56ec00 100644
--- a/chrome/test/mini_installer_test/chrome_mini_installer.cc
+++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc
@@ -113,8 +113,8 @@
ASSERT_TRUE(file_util::PathExists(uninstall_path));
printf("\nUninstalling Chrome...\n");
- process_util::LaunchApp(L"\"" + uninstall_path + L"\"" + L" -uninstall",
- false, false, NULL);
+ base::LaunchApp(L"\"" + uninstall_path + L"\"" + L" -uninstall",
+ false, false, NULL);
printf("\nLaunched setup.exe -uninstall....\n");
ASSERT_TRUE(CloseWindow(mini_installer_constants::kChromeBuildType,
WM_COMMAND));
@@ -124,8 +124,8 @@
DeleteAppFolder();
FindChromeShortcut();
CloseProcesses(mini_installer_constants::kIEExecutable);
- ASSERT_EQ(0, process_util::GetProcessCount(
- mini_installer_constants::kIEExecutable, NULL));
+ ASSERT_EQ(0,
+ base::GetProcessCount(mini_installer_constants::kIEExecutable, NULL));
}
// Takes care of Chrome uninstall dialog.
@@ -154,13 +154,13 @@
// Checks for all requested running processes and kills them.
void ChromeMiniInstaller::CloseProcesses(const std::wstring& executable_name) {
int timer = 0;
- while ((process_util::GetProcessCount(executable_name, NULL) > 0) &&
+ while ((base::GetProcessCount(executable_name, NULL) > 0) &&
(timer < 20000)) {
- process_util::KillProcesses(executable_name, 1, NULL);
+ base::KillProcesses(executable_name, 1, NULL);
Sleep(200);
timer = timer + 200;
}
- ASSERT_EQ(0, process_util::GetProcessCount(executable_name, NULL));
+ ASSERT_EQ(0, base::GetProcessCount(executable_name, NULL));
}
// Checks for Chrome registry keys.
@@ -256,7 +256,7 @@
const wchar_t process_name[]) {
printf("\nBuild to be installed is: %ls\n", path.c_str());
ASSERT_TRUE(file_util::PathExists(path));
- process_util::LaunchApp(L"\"" + path + L"\"", false, false, NULL);
+ base::LaunchApp(L"\"" + path + L"\"", false, false, NULL);
printf("Waiting while this process is running %ls ....", process_name);
WaitUntilProcessStartsRunning(process_name);
WaitUntilProcessStopsRunning(process_name);
@@ -268,7 +268,7 @@
ASSERT_TRUE(PathService::Get(base::DIR_LOCAL_APP_DATA, &path));
file_util::AppendToPath(&path, mini_installer_constants::kChromeAppDir);
file_util::AppendToPath(&path, installer_util::kChromeExe);
- process_util::LaunchApp(L"\"" + path + L"\"", false, false, NULL);
+ base::LaunchApp(L"\"" + path + L"\"", false, false, NULL);
WaitUntilProcessStartsRunning(installer_util::kChromeExe);
Sleep(1200);
}
@@ -297,12 +297,12 @@
void ChromeMiniInstaller::WaitUntilProcessStartsRunning(
const wchar_t process_name[]) {
int timer = 0;
- while ((process_util::GetProcessCount(process_name, NULL) == 0) &&
+ while ((base::GetProcessCount(process_name, NULL) == 0) &&
(timer < 60000)) {
Sleep(200);
timer = timer + 200;
}
- ASSERT_NE(0, process_util::GetProcessCount(process_name, NULL));
+ ASSERT_NE(0, base::GetProcessCount(process_name, NULL));
}
// Waits until the process stops running.
@@ -310,11 +310,11 @@
const wchar_t process_name[]) {
int timer = 0;
printf("\nWaiting for this process to end... %ls\n", process_name);
- while ((process_util::GetProcessCount(process_name, NULL) > 0) &&
+ while ((base::GetProcessCount(process_name, NULL) > 0) &&
(timer < 60000)) {
Sleep(200);
timer = timer + 200;
}
- ASSERT_EQ(0, process_util::GetProcessCount(process_name, NULL));
+ ASSERT_EQ(0, base::GetProcessCount(process_name, NULL));
}
diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc
index aab3eed..59d0ce8 100644
--- a/chrome/test/page_cycler/page_cycler_test.cc
+++ b/chrome/test/page_cycler/page_cycler_test.cc
@@ -90,7 +90,7 @@
void PrintIOPerfInfo(const wchar_t* test_name) {
BrowserProcessFilter chrome_filter(L"");
- process_util::NamedProcessIterator
+ base::NamedProcessIterator
chrome_process_itr(chrome::kBrowserProcessExecutableName,
&chrome_filter);
@@ -101,10 +101,10 @@
false,
pid);
- scoped_ptr<process_util::ProcessMetrics> process_metrics;
+ scoped_ptr<base::ProcessMetrics> process_metrics;
IO_COUNTERS io_counters;
process_metrics.reset(
- process_util::ProcessMetrics::CreateProcessMetrics(process_handle));
+ base::ProcessMetrics::CreateProcessMetrics(process_handle));
ZeroMemory(&io_counters, sizeof(io_counters));
if (process_metrics.get()->GetIOCounters(&io_counters)) {
@@ -160,7 +160,7 @@
void PrintMemoryUsageInfo(const wchar_t* test_name) {
BrowserProcessFilter chrome_filter(L"");
- process_util::NamedProcessIterator
+ base::NamedProcessIterator
chrome_process_itr(chrome::kBrowserProcessExecutableName,
&chrome_filter);
diff --git a/chrome/test/perf/mem_usage.cc b/chrome/test/perf/mem_usage.cc
index c1d7941..fdfa4352 100644
--- a/chrome/test/perf/mem_usage.cc
+++ b/chrome/test/perf/mem_usage.cc
@@ -81,7 +81,7 @@
void PrintChromeMemoryUsageInfo() {
printf("\n");
BrowserProcessFilter chrome_filter(L"");
- process_util::NamedProcessIterator
+ base::NamedProcessIterator
chrome_process_itr(chrome::kBrowserProcessExecutableName, &chrome_filter);
const PROCESSENTRY32* chrome_entry;
diff --git a/chrome/test/perf/perftests.cc b/chrome/test/perf/perftests.cc
index 2b1e4e5..3e67a6b 100644
--- a/chrome/test/perf/perftests.cc
+++ b/chrome/test/perf/perftests.cc
@@ -11,7 +11,7 @@
// TODO(darin): share code with base/run_all_perftests.cc
int main(int argc, char **argv) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
chrome::RegisterPathProvider();
MessageLoop main_message_loop;
diff --git a/chrome/test/reliability/run_all_unittests.cc b/chrome/test/reliability/run_all_unittests.cc
index bb045ca..1f7b2a3 100644
--- a/chrome/test/reliability/run_all_unittests.cc
+++ b/chrome/test/reliability/run_all_unittests.cc
@@ -7,7 +7,7 @@
#include "chrome/test/reliability/reliability_test_suite.h"
int main(int argc, char **argv) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
return ReliabilityTestSuite(argc, argv).Run();
}
diff --git a/chrome/test/ui/run_all_unittests.cc b/chrome/test/ui/run_all_unittests.cc
index 4400f9b6f..1670f1c 100644
--- a/chrome/test/ui/run_all_unittests.cc
+++ b/chrome/test/ui/run_all_unittests.cc
@@ -8,7 +8,7 @@
#include "chrome/test/ui/ui_test_suite.h"
int main(int argc, char **argv) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
PlatformThread::SetName("Tests_Main");
return UITestSuite(argc, argv).Run();
}
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index f4371d2..41b1325d 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -239,12 +239,11 @@
browser_launch_time_ = TimeTicks::Now();
- bool started = process_util::LaunchApp(
- command_line,
- false, // Don't wait for process object (doesn't work for
- // us)
- !show_window_,
- &process_);
+ bool started = base::LaunchApp(command_line,
+ false, // Don't wait for process object
+ // (doesn't work for us)
+ !show_window_,
+ &process_);
ASSERT_EQ(started, true);
if (use_existing_browser_) {
@@ -253,7 +252,7 @@
user_data_dir_.c_str());
GetWindowThreadProcessId(hwnd, &pid);
// This mode doesn't work if we wound up launching a new browser ourselves.
- ASSERT_NE(pid, process_util::GetProcId(process_));
+ ASSERT_NE(pid, base::GetProcId(process_));
CloseHandle(process_);
process_ = OpenProcess(SYNCHRONIZE, false, pid);
}
@@ -317,9 +316,9 @@
// Make sure that no instances of the browser remain.
const int kExitTimeoutMs = 5000;
const int kExitCode = 1;
- process_util::CleanupProcesses(
- chrome::kBrowserProcessExecutableName, kExitTimeoutMs, kExitCode,
- &filter);
+ base::CleanupProcesses(
+ chrome::kBrowserProcessExecutableName, kExitTimeoutMs, kExitCode,
+ &filter);
// Suppress spammy failures that seem to be occurring when running
// the UI tests in single-process mode.
@@ -442,8 +441,8 @@
/*static*/
int UITest::GetBrowserProcessCount() {
BrowserProcessFilter filter(L"");
- return process_util::GetProcessCount(chrome::kBrowserProcessExecutableName,
- &filter);
+ return base::GetProcessCount(chrome::kBrowserProcessExecutableName,
+ &filter);
}
static DictionaryValue* LoadDictionaryValueFromPath(const std::wstring& path) {
diff --git a/chrome/test/unit/run_all_unittests.cc b/chrome/test/unit/run_all_unittests.cc
index 97d6719a..4d16777 100644
--- a/chrome/test/unit/run_all_unittests.cc
+++ b/chrome/test/unit/run_all_unittests.cc
@@ -13,7 +13,7 @@
#endif
int main(int argc, char **argv) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
#if defined(OS_WIN)
// TODO(port): This is not Windows-specific, but needs to be ported.
return ChromeTestSuite(argc, argv).Run();
diff --git a/chrome/tools/convert_dict/convert_dict.cc b/chrome/tools/convert_dict/convert_dict.cc
index ab486ac..870e322 100644
--- a/chrome/tools/convert_dict/convert_dict.cc
+++ b/chrome/tools/convert_dict/convert_dict.cc
@@ -71,7 +71,7 @@
} // namespace
int main(int argc, char* argv[]) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
if (argc != 2)
return PrintHelp();
diff --git a/chrome/tools/perf/flush_cache/flush_cache.cc b/chrome/tools/perf/flush_cache/flush_cache.cc
index f10b69b..fa231d4 100644
--- a/chrome/tools/perf/flush_cache/flush_cache.cc
+++ b/chrome/tools/perf/flush_cache/flush_cache.cc
@@ -11,7 +11,7 @@
#include "chrome/test/test_file_util.h"
int main(int argc, const char* argv[]) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
if (argc <= 1) {
fprintf(stderr, "flushes disk cache for files\n");
fprintf(stderr, "usage: %s <filenames>\n", argv[0]);
diff --git a/chrome/tools/profiles/generate_profile.cc b/chrome/tools/profiles/generate_profile.cc
index d60f3ae..42685a9 100644
--- a/chrome/tools/profiles/generate_profile.cc
+++ b/chrome/tools/profiles/generate_profile.cc
@@ -181,7 +181,7 @@
}
int main(int argc, const char* argv[]) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
base::AtExitManager exit_manager;
int next_arg = 1;
diff --git a/chrome/tools/test/image_diff/image_diff.cc b/chrome/tools/test/image_diff/image_diff.cc
index 7b696d4..7fa6f48 100644
--- a/chrome/tools/test/image_diff/image_diff.cc
+++ b/chrome/tools/test/image_diff/image_diff.cc
@@ -233,7 +233,7 @@
}
int main(int argc, const char* argv[]) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
#if defined(OS_WIN)
CommandLine parsed_command_line;
#elif defined(OS_POSIX)
diff --git a/net/tools/tld_cleanup/tld_cleanup.cc b/net/tools/tld_cleanup/tld_cleanup.cc
index 943caec..0978d80 100644
--- a/net/tools/tld_cleanup/tld_cleanup.cc
+++ b/net/tools/tld_cleanup/tld_cleanup.cc
@@ -206,7 +206,7 @@
}
int main(int argc, const char* argv[]) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
if (argc != 3) {
fprintf(stderr, "Normalizes and verifies UTF-8 TLD data files\n");
fprintf(stderr, "Usage: %s <input> <output>\n", argv[0]);
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 22372db..7e30b37 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -48,7 +48,7 @@
final_upload_progress_(0) {
URLREQUEST_COUNT_CTOR();
SIMPLE_STATS_COUNTER(L"URLRequestCount");
- origin_pid_ = process_util::GetCurrentProcId();
+ origin_pid_ = base::GetCurrentProcId();
// Sanity check out environment.
DCHECK(MessageLoop::current()) <<
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h
index e60f402f..c8498c5 100644
--- a/net/url_request/url_request_unittest.h
+++ b/net/url_request/url_request_unittest.h
@@ -185,7 +185,7 @@
// This object bounds the lifetime of an external python-based HTTP server
// that can provide various responses useful for testing.
-class TestServer : public process_util::ProcessFilter {
+class TestServer : public base::ProcessFilter {
public:
TestServer(const std::wstring& document_root)
: process_handle_(NULL),
@@ -205,7 +205,7 @@
if (!process_handle_)
return false;
// TODO(port): rationalize return value of GetProcId
- return pid == (uint32)process_util::GetProcId(process_handle_);
+ return pid == (uint32)base::GetProcId(process_handle_);
}
GURL TestServerPage(const std::string& path) {
@@ -293,7 +293,7 @@
}
ASSERT_TRUE(
- process_util::LaunchApp(command_line, false, true, &process_handle_)) <<
+ base::LaunchApp(command_line, false, true, &process_handle_)) <<
"Failed to launch " << command_line;
#elif defined(OS_LINUX)
bool tlslite_installed = !access("/usr/bin/tls.py", X_OK);
@@ -357,8 +357,8 @@
// Make sure we don't leave any stray testserver processes laying around.
std::wstring testserver_name =
file_util::GetFilenameFromPath(python_runtime_);
- process_util::CleanupProcesses(testserver_name, 10000, 1, this);
- EXPECT_EQ(0, process_util::GetProcessCount(testserver_name, this));
+ base::CleanupProcesses(testserver_name, 10000, 1, this);
+ EXPECT_EQ(0, base::GetProcessCount(testserver_name, this));
is_shutdown_ = true;
}
@@ -391,7 +391,7 @@
std::string base_address_;
std::wstring python_runtime_;
- ProcessHandle process_handle_;
+ base::ProcessHandle process_handle_;
bool is_shutdown_;
};
diff --git a/webkit/glue/resource_handle_impl.cc b/webkit/glue/resource_handle_impl.cc
index a7d72a7..37528d6 100644
--- a/webkit/glue/resource_handle_impl.cc
+++ b/webkit/glue/resource_handle_impl.cc
@@ -402,7 +402,7 @@
// have a origin_pid. Find a better place to set this.
int origin_pid = request_.originPid();
if (origin_pid == 0)
- origin_pid = process_util::GetCurrentProcId();
+ origin_pid = base::GetCurrentProcId();
bool mixed_content =
webkit_glue::KURLToGURL(request_.mainDocumentURL()).SchemeIsSecure() &&
diff --git a/webkit/glue/scoped_clipboard_writer_glue.h b/webkit/glue/scoped_clipboard_writer_glue.h
index 5a3ecb5..6307e6a 100644
--- a/webkit/glue/scoped_clipboard_writer_glue.h
+++ b/webkit/glue/scoped_clipboard_writer_glue.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SCOPED_CLIPBOARD_WRITER_GLUE_H__
-#define SCOPED_CLIPBOARD_WRITER_GLUE_H__
+#ifndef SCOPED_CLIPBOARD_WRITER_GLUE_H_
+#define SCOPED_CLIPBOARD_WRITER_GLUE_H_
#include "base/clipboard.h"
#include "base/scoped_clipboard_writer.h"
@@ -22,8 +22,8 @@
#endif
private:
- SharedMemory* shared_buf_;
+ base::SharedMemory* shared_buf_;
DISALLOW_COPY_AND_ASSIGN(ScopedClipboardWriterGlue);
};
-#endif // SCOPED_CLIPBOARD_WRITER_GLUE_H__
+#endif // SCOPED_CLIPBOARD_WRITER_GLUE_H_
diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc
index 9a7f55b..1798f85 100644
--- a/webkit/tools/test_shell/run_all_tests.cc
+++ b/webkit/tools/test_shell/run_all_tests.cc
@@ -34,7 +34,7 @@
"</script>";
int main(int argc, char* argv[]) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
// Some unittests may use base::Singleton<>, thus we need to instanciate
// the AtExitManager or else we will leak objects.
base::AtExitManager at_exit_manager;
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc
index 21e57bb..a8f1fd4 100644
--- a/webkit/tools/test_shell/test_shell_main.cc
+++ b/webkit/tools/test_shell/test_shell_main.cc
@@ -129,7 +129,7 @@
int main(int argc, char* argv[]) {
- process_util::EnableTerminationOnHeapCorruption();
+ base::EnableTerminationOnHeapCorruption();
#ifdef _CRTDBG_MAP_ALLOC
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);