Bug 1062719 - remove Chromium debug flags, task queue from IPC code. rs=bent

This commit is contained in:
Josh Aas 2014-09-04 00:24:27 -05:00
parent 9a21278a8e
commit 3b7d375a99
5 changed files with 0 additions and 162 deletions

View File

@ -66,7 +66,6 @@ UNIFIED_SOURCES += [
'src/chrome/common/child_process_info.cc',
'src/chrome/common/child_thread.cc',
'src/chrome/common/chrome_switches.cc',
'src/chrome/common/debug_flags.cc',
'src/chrome/common/env_vars.cc',
'src/chrome/common/ipc_channel_proxy.cc',
'src/chrome/common/ipc_logging.cc',
@ -75,7 +74,6 @@ UNIFIED_SOURCES += [
'src/chrome/common/ipc_sync_message.cc',
'src/chrome/common/message_router.cc',
'src/chrome/common/notification_service.cc',
'src/chrome/common/task_queue.cc',
]
if os_win:

View File

@ -1,44 +0,0 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/debug_flags.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
bool DebugFlags::ProcessDebugFlags(CommandLine* command_line,
ChildProcessInfo::ProcessType type,
bool is_in_sandbox) {
bool should_help_child = false;
const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess();
if (current_cmd_line.HasSwitch(switches::kDebugChildren)) {
// Look to pass-on the kDebugOnStart flag.
std::wstring value;
value = current_cmd_line.GetSwitchValue(switches::kDebugChildren);
if (value.empty() ||
(type == ChildProcessInfo::RENDER_PROCESS &&
value == switches::kRendererProcess) ||
(type == ChildProcessInfo::PLUGIN_PROCESS &&
value == switches::kPluginProcess)) {
command_line->AppendSwitch(switches::kDebugOnStart);
should_help_child = true;
}
command_line->AppendSwitchWithValue(switches::kDebugChildren, value);
} else if (current_cmd_line.HasSwitch(switches::kWaitForDebuggerChildren)) {
// Look to pass-on the kWaitForDebugger flag.
std::wstring value;
value = current_cmd_line.GetSwitchValue(switches::kWaitForDebuggerChildren);
if (value.empty() ||
(type == ChildProcessInfo::RENDER_PROCESS &&
value == switches::kRendererProcess) ||
(type == ChildProcessInfo::PLUGIN_PROCESS &&
value == switches::kPluginProcess)) {
command_line->AppendSwitch(switches::kWaitForDebugger);
}
command_line->AppendSwitchWithValue(switches::kWaitForDebuggerChildren,
value);
}
return should_help_child;
}

View File

@ -1,28 +0,0 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_DEBUG_FLAGS_H__
#define CHROME_COMMON_DEBUG_FLAGS_H__
#include "chrome/common/child_process_info.h"
class CommandLine;
class DebugFlags {
public:
// Updates the command line arguments with debug-related flags. If
// debug flags have been used with this process, they will be
// filtered and added to command_line as needed. is_in_sandbox must
// be true if the child process will be in a sandbox.
//
// Returns true if the caller should "help" the child process by
// calling the JIT debugger on it. It may only happen if
// is_in_sandbox is true.
static bool ProcessDebugFlags(CommandLine* command_line,
ChildProcessInfo::ProcessType type,
bool is_in_sandbox);
};
#endif // CHROME_COMMON_DEBUG_FLAGS_H__

View File

@ -1,46 +0,0 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/task_queue.h"
#include "base/stl_util-inl.h"
TaskQueue::TaskQueue() {
}
TaskQueue::~TaskQueue() {
// We own all the pointes in |queue_|. It is our job to delete them.
STLDeleteElements(&queue_);
}
void TaskQueue::Run() {
// Nothing to run if our queue is empty.
if (queue_.empty())
return;
std::deque<Task*> ready;
queue_.swap(ready);
// Run the tasks that are ready.
std::deque<Task*>::const_iterator task;
for (task = ready.begin(); task != ready.end(); ++task) {
// Run the task and then delete it.
(*task)->Run();
delete (*task);
}
}
void TaskQueue::Push(Task* task) {
// Add the task to the back of the queue.
queue_.push_back(task);
}
void TaskQueue::Clear() {
// Delete all the elements in the queue and clear the dead pointers.
STLDeleteElements(&queue_);
}
bool TaskQueue::Empty() const {
return queue_.empty();
}

View File

@ -1,42 +0,0 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_COMMON_TASK_QUEUE_H__
#define CHROME_COMMON_TASK_QUEUE_H__
#include <deque>
#include "base/task.h"
// A TaskQueue is a queue of tasks waiting to be run. To run the tasks, call
// the Run method. A task queue is itself a Task so that it can be placed in a
// message loop or another task queue.
class TaskQueue : public Task {
public:
TaskQueue();
~TaskQueue();
// Run all the tasks in the queue. New tasks pushed onto the queue during
// a run will be run next time |Run| is called.
virtual void Run();
// Push the specified task onto the queue. When the queue is run, the tasks
// will be run in the order they are pushed.
//
// This method takes ownership of |task| and will delete task after it is run
// (or when the TaskQueue is destroyed, if we never got a chance to run it).
void Push(Task* task);
// Remove all tasks from the queue. The tasks are deleted.
void Clear();
// Returns true if this queue contains no tasks.
bool Empty() const;
private:
// The list of tasks we are waiting to run.
std::deque<Task*> queue_;
};
#endif // CHROME_COMMON_TASK_QUEUE_H__