Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: remoting/host/event_executor_linux.cc

Issue 11316267: Avoid posting tasks from a constructor of a ref-counted object because doing so might cause prematu… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/event_executor_linux.cc
diff --git a/remoting/host/event_executor_linux.cc b/remoting/host/event_executor_linux.cc
index b3176e328244fba1431966881e7e08685ef610a7..9c0326e8528335bfaa59254a8eb598ab7fc29b00 100644
--- a/remoting/host/event_executor_linux.cc
+++ b/remoting/host/event_executor_linux.cc
@@ -164,15 +164,16 @@ EventExecutorLinux::Core::Core(
wheel_ticks_y_(0.0f),
display_(XOpenDisplay(NULL)),
root_window_(BadValue) {
-#if defined(REMOTING_HOST_LINUX_CLIPBOARD)
- if (!task_runner_->BelongsToCurrentThread())
- task_runner_->PostTask(FROM_HERE, base::Bind(&Core::InitClipboard, this));
-#endif // REMOTING_HOST_LINUX_CLIPBOARD
}
bool EventExecutorLinux::Core::Init() {
CHECK(display_);
+#if defined(REMOTING_HOST_LINUX_CLIPBOARD)
+ if (!task_runner_->BelongsToCurrentThread())
+ task_runner_->PostTask(FROM_HERE, base::Bind(&Core::InitClipboard, this));
+#endif // REMOTING_HOST_LINUX_CLIPBOARD
+
root_window_ = RootWindow(display_, DefaultScreen(display_));
if (root_window_ == BadValue) {
LOG(ERROR) << "Unable to get the root window";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698