Proof-reading comments in base/message_loop/.
This CL contains a few minor changes to comments that I made while
skimming through the code. Mostly spelling changes.
Review URL: https://codereview.chromium.org/1255673004
Cr-Commit-Position: refs/heads/master@{#340383}
CrOS-Libchrome-Original-Commit: 15926f8886b8fa20c044c02eb0387f44e611c993
diff --git a/base/message_loop/incoming_task_queue.cc b/base/message_loop/incoming_task_queue.cc
index 5e9a461..eab14e9 100644
--- a/base/message_loop/incoming_task_queue.cc
+++ b/base/message_loop/incoming_task_queue.cc
@@ -147,7 +147,7 @@
}
// Initialize the sequence number. The sequence number is used for delayed
- // tasks (to faciliate FIFO sorting when two tasks have the same
+ // tasks (to facilitate FIFO sorting when two tasks have the same
// delayed_run_time value) and for identifying the task in about:tracing.
pending_task->sequence_num = next_sequence_num_++;
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 6bd6730..0ae13cb 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -44,7 +44,7 @@
LazyInstance<base::ThreadLocalPointer<MessageLoop> >::Leaky lazy_tls_ptr =
LAZY_INSTANCE_INITIALIZER;
-// Logical events for Histogram profiling. Run with -message-loop-histogrammer
+// Logical events for Histogram profiling. Run with --message-loop-histogrammer
// to get an accounting of messages and actions taken on each thread.
const int kTaskRunEvent = 0x1;
#if !defined(OS_NACL)
@@ -56,9 +56,9 @@
const int kNumberOfDistinctMessagesDisplayed = 1100;
// Provide a macro that takes an expression (such as a constant, or macro
-// constant) and creates a pair to initalize an array of pairs. In this case,
+// constant) and creates a pair to initialize an array of pairs. In this case,
// our pair consists of the expressions value, and the "stringized" version
-// of the expression (i.e., the exrpression put in quotes). For example, if
+// of the expression (i.e., the expression put in quotes). For example, if
// we have:
// #define FOO 2
// #define BAR 5
@@ -79,7 +79,7 @@
VALUE_TO_NUMBER_AND_NAME(kTaskRunEvent)
VALUE_TO_NUMBER_AND_NAME(kTimerEvent)
- {-1, NULL} // The list must be null terminated, per API to histogram.
+ {-1, NULL} // The list must be null-terminated, per API to histogram.
};
#endif // !defined(OS_NACL)
@@ -362,7 +362,7 @@
}
bool MessageLoop::IsIdleForTesting() {
- // We only check the imcoming queue|, since we don't want to lock the work
+ // We only check the incoming queue, since we don't want to lock the work
// queue.
return incoming_task_queue_->IsIdleForTesting();
}
@@ -423,7 +423,7 @@
void MessageLoop::SetThreadTaskRunnerHandle() {
DCHECK_EQ(this, current());
- // Clear the previous thread task runner first because only one can exist at
+ // Clear the previous thread task runner first, because only one can exist at
// a time.
thread_task_runner_handle_.reset();
thread_task_runner_handle_.reset(new ThreadTaskRunnerHandle(task_runner_));
@@ -615,7 +615,7 @@
return false;
}
- // When we "fall behind," there will be a lot of tasks in the delayed work
+ // When we "fall behind", there will be a lot of tasks in the delayed work
// queue that are ready to run. To increase efficiency when we fall behind,
// we will only call Time::Now() intermittently, and then process all tasks
// that are ready to run before calling it again. As a result, the more we
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h
index fbb8309..63a29f1 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -308,18 +308,18 @@
void SetTaskRunner(scoped_refptr<SingleThreadTaskRunner> task_runner);
// Enables or disables the recursive task processing. This happens in the case
- // of recursive message loops. Some unwanted message loop may occurs when
+ // of recursive message loops. Some unwanted message loops may occur when
// using common controls or printer functions. By default, recursive task
// processing is disabled.
//
- // Please utilize |ScopedNestableTaskAllower| instead of calling these methods
- // directly. In general nestable message loops are to be avoided. They are
+ // Please use |ScopedNestableTaskAllower| instead of calling these methods
+ // directly. In general, nestable message loops are to be avoided. They are
// dangerous and difficult to get right, so please use with extreme caution.
//
// The specific case where tasks get queued is:
// - The thread is running a message loop.
- // - It receives a task #1 and execute it.
- // - The task #1 implicitly start a message loop, like a MessageBox in the
+ // - It receives a task #1 and executes it.
+ // - The task #1 implicitly starts a message loop, like a MessageBox in the
// unit test. This can also be StartDoc or GetSaveFileName.
// - The thread receives a task #2 before or while in this second message
// loop.
@@ -420,7 +420,7 @@
// and then pass it to the thread where the message loop actually runs.
// The message loop's BindToCurrentThread() method must be called on the
// thread the message loop runs on, before calling Run().
- // Before BindToCurrentThread() is called only Post*Task() functions can
+ // Before BindToCurrentThread() is called, only Post*Task() functions can
// be called on the message loop.
static scoped_ptr<MessageLoop> CreateUnbound(
Type type,
@@ -511,7 +511,7 @@
bool nestable_tasks_allowed_;
#if defined(OS_WIN)
- // Should be set to true before calling Windows APIs like TrackPopupMenu, etc
+ // Should be set to true before calling Windows APIs like TrackPopupMenu, etc.
// which enter a modal message loop.
bool os_modal_loop_;
#endif
diff --git a/base/message_loop/message_loop_task_runner_unittest.cc b/base/message_loop/message_loop_task_runner_unittest.cc
index caf88af..a0d84b7 100644
--- a/base/message_loop/message_loop_task_runner_unittest.cc
+++ b/base/message_loop/message_loop_task_runner_unittest.cc
@@ -30,7 +30,7 @@
protected:
void SetUp() override {
// Use SetUp() instead of the constructor to avoid posting a task to a
- // partialy constructed object.
+ // partially constructed object.
task_thread_.Start();
// Allow us to pause the |task_thread_|'s MessageLoop.
@@ -41,7 +41,7 @@
void TearDown() override {
// Make sure the |task_thread_| is not blocked, and stop the thread
- // fully before destuction because its tasks may still depend on the
+ // fully before destruction because its tasks may still depend on the
// |thread_sync_| event.
thread_sync_.Signal();
task_thread_.Stop();
@@ -244,7 +244,7 @@
// it, we cannot just delete it because PostTaskAndReplyRelay's destructor
// checks that MessageLoop::current() is the the same as when the
// PostTaskAndReplyRelay object was constructed. However, this loop must have
- // aleady been deleted in order to perform this test. See
+ // already been deleted in order to perform this test. See
// http://crbug.com/86301.
}
diff --git a/base/message_loop/message_loop_unittest.cc b/base/message_loop/message_loop_unittest.cc
index 9c17017..89f9a40 100644
--- a/base/message_loop/message_loop_unittest.cc
+++ b/base/message_loop/message_loop_unittest.cc
@@ -119,7 +119,7 @@
Bind(&RecordRunTimeFunc, &run_time, &num_tasks),
TimeDelta::FromSeconds(1000));
- // This slightly delayed task should run from within SubPumpFunc).
+ // This slightly delayed task should run from within SubPumpFunc.
loop.PostDelayedTask(
FROM_HERE,
Bind(&PostQuitMessage, 0),
@@ -600,7 +600,7 @@
TestIOHandler handler2(kPipeName2, callback2_called.Get(), true);
thread_loop->PostTask(FROM_HERE, Bind(&TestIOHandler::Init,
Unretained(&handler1)));
- // TODO(ajwong): Do we really need such long Sleeps in ths function?
+ // TODO(ajwong): Do we really need such long Sleeps in this function?
// Make sure the thread runs and sleeps for lack of work.
TimeDelta delay = TimeDelta::FromMilliseconds(100);
PlatformThread::Sleep(delay);
@@ -645,7 +645,7 @@
RunTest_PostDelayedTask_SharedTimer_SubPump();
}
-// This test occasionally hangs http://crbug.com/44567
+// This test occasionally hangs. See http://crbug.com/44567.
TEST(MessageLoopTest, DISABLED_RecursiveDenial2) {
RunTest_RecursiveDenial2(MessageLoop::TYPE_DEFAULT);
RunTest_RecursiveDenial2(MessageLoop::TYPE_UI);
@@ -653,7 +653,7 @@
}
TEST(MessageLoopTest, RecursiveSupport2) {
- // This test requires a UI loop
+ // This test requires a UI loop.
RunTest_RecursiveSupport2(MessageLoop::TYPE_UI);
}
#endif // defined(OS_WIN)
diff --git a/base/message_loop/message_pump_glib.cc b/base/message_loop/message_pump_glib.cc
index f06f60d..fd23745 100644
--- a/base/message_loop/message_pump_glib.cc
+++ b/base/message_loop/message_pump_glib.cc
@@ -52,7 +52,7 @@
// returns FALSE, GLib will destroy the source. Dispatch calls may be recursive
// (i.e., you can call Run from them), but Prepare and Check cannot.
// Finalize is called when the source is destroyed.
-// NOTE: It is common for subsytems to want to process pending events while
+// NOTE: It is common for subsystems to want to process pending events while
// doing intensive work, for example the flash plugin. They usually use the
// following pattern (recommended by the GTK docs):
// while (gtk_events_pending()) {
@@ -350,7 +350,7 @@
void MessagePumpGlib::ScheduleDelayedWork(const TimeTicks& delayed_work_time) {
// We need to wake up the loop in case the poll timeout needs to be
- // adjusted. This will cause us to try to do work, but that's ok.
+ // adjusted. This will cause us to try to do work, but that's OK.
delayed_work_time_ = delayed_work_time;
ScheduleWork();
}