summaryrefslogtreecommitdiffstats
path: root/chromium/base/message_loop/message_loop.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-25 11:39:07 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-01-25 15:20:42 +0000
commit6c91641271e536ffaa88a1dff5127e42ee99a91e (patch)
tree703d9dd49602377ddc90cbf886aad37913f2496b /chromium/base/message_loop/message_loop.cc
parentb145b7fafd36f0c260d6a768c81fc14e32578099 (diff)
BASELINE: Update Chromium to 49.0.2623.23
Also adds missing printing sources. Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/base/message_loop/message_loop.cc')
-rw-r--r--chromium/base/message_loop/message_loop.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/chromium/base/message_loop/message_loop.cc b/chromium/base/message_loop/message_loop.cc
index a44f46863e4..e84765a0f7a 100644
--- a/chromium/base/message_loop/message_loop.cc
+++ b/chromium/base/message_loop/message_loop.cc
@@ -5,6 +5,7 @@
#include "base/message_loop/message_loop.h"
#include <algorithm>
+#include <utility>
#include "base/bind.h"
#include "base/compiler_specific.h"
@@ -21,6 +22,7 @@
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/tracked_objects.h"
+#include "build/build_config.h"
#if defined(OS_MACOSX)
#include "base/message_loop/message_pump_mac.h"
@@ -131,9 +133,11 @@ MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
}
MessageLoop::~MessageLoop() {
- // current() could be NULL if this message loop is destructed before it is
- // bound to a thread.
- DCHECK(current() == this || !current());
+ // If |pump_| is non-null, this message loop has been bound and should be the
+ // current one on this thread. Otherwise, this loop is being destructed before
+ // it was bound to a thread, so a different message loop (or no loop at all)
+ // may be current.
+ DCHECK((pump_ && current() == this) || (!pump_ && current() != this));
// iOS just attaches to the loop, it doesn't Run it.
// TODO(stuartmorgan): Consider wiring up a Detach().
@@ -175,7 +179,8 @@ MessageLoop::~MessageLoop() {
task_runner_ = NULL;
// OK, now make it so that no one can find us.
- lazy_tls_ptr.Pointer()->Set(NULL);
+ if (current() == this)
+ lazy_tls_ptr.Pointer()->Set(nullptr);
}
// static
@@ -417,7 +422,7 @@ void MessageLoop::SetTaskRunner(
DCHECK_EQ(this, current());
DCHECK(task_runner->BelongsToCurrentThread());
DCHECK(!unbound_task_runner_);
- task_runner_ = task_runner.Pass();
+ task_runner_ = std::move(task_runner);
SetThreadTaskRunnerHandle();
}