Commit d3a040ee authored by Alexander Timin's avatar Alexander Timin Committed by Commit Bot

[message_loop] Clean up MessageLoopCurrent a bit.

- Do not allow assigning MessageLoop to MessageLoopCurrent.
- Remove hash operator from MessageLoopCurrent.

R=alexclarke@chromium.org,gab@chromium.org
TBR=gab@chromium.org
BUG=891670

Change-Id: If558357328d1b07abaa5ccf7bcba5f9ef3609531
Reviewed-on: https://chromium-review.googlesource.com/c/1322874Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606033}
parent 6d5ea873
...@@ -40,11 +40,6 @@ bool MessageLoopCurrent::IsSet() { ...@@ -40,11 +40,6 @@ bool MessageLoopCurrent::IsSet() {
return !!GetTLSMessageLoop()->Get(); return !!GetTLSMessageLoop()->Get();
} }
MessageLoopCurrent& MessageLoopCurrent::operator=(MessageLoop* message_loop) {
current_ = message_loop;
return *this;
}
void MessageLoopCurrent::AddDestructionObserver( void MessageLoopCurrent::AddDestructionObserver(
DestructionObserver* destruction_observer) { DestructionObserver* destruction_observer) {
DCHECK_CALLED_ON_VALID_THREAD(current_->bound_thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(current_->bound_thread_checker_);
......
...@@ -58,10 +58,6 @@ class BASE_EXPORT MessageLoopCurrent { ...@@ -58,10 +58,6 @@ class BASE_EXPORT MessageLoopCurrent {
MessageLoopCurrent(MessageLoopCurrent&& other) = default; MessageLoopCurrent(MessageLoopCurrent&& other) = default;
MessageLoopCurrent& operator=(const MessageLoopCurrent& other) = default; MessageLoopCurrent& operator=(const MessageLoopCurrent& other) = default;
// TODO(altimin): Remove this. Currently it's used in places where the caller
// has access to MessageLoop due to owning it.
MessageLoopCurrent& operator=(MessageLoop* message_loop);
bool operator==(const MessageLoopCurrent& other) const; bool operator==(const MessageLoopCurrent& other) const;
// Returns a proxy object to interact with the MessageLoop running the // Returns a proxy object to interact with the MessageLoop running the
...@@ -209,7 +205,6 @@ class BASE_EXPORT MessageLoopCurrent { ...@@ -209,7 +205,6 @@ class BASE_EXPORT MessageLoopCurrent {
friend class Thread; friend class Thread;
friend class sequence_manager::LazyThreadControllerForTest; friend class sequence_manager::LazyThreadControllerForTest;
friend class sequence_manager::internal::SequenceManagerImpl; friend class sequence_manager::internal::SequenceManagerImpl;
friend struct std::hash<MessageLoopCurrent>;
friend class MessageLoopTaskRunnerTest; friend class MessageLoopTaskRunnerTest;
friend class web::TestWebThreadBundle; friend class web::TestWebThreadBundle;
...@@ -332,15 +327,4 @@ class BASE_EXPORT MessageLoopCurrentForIO : public MessageLoopCurrent { ...@@ -332,15 +327,4 @@ class BASE_EXPORT MessageLoopCurrentForIO : public MessageLoopCurrent {
} // namespace base } // namespace base
namespace std {
template <>
struct hash<base::MessageLoopCurrent> {
size_t operator()(const base::MessageLoopCurrent& loop) {
return std::hash<void*>()(loop.current_);
}
};
} // namespace std
#endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_CURRENT_H_ #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_CURRENT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment