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

Unified Diff: cc/trees/single_thread_proxy.h

Issue 1995983002: Fix "unused variable" warnings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
Index: cc/trees/single_thread_proxy.h
diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h
index c513964f7742454c22950222098c19cc69e7b76c..b5e6691a9bb8cb5194ff9ebe59a47d523ec50b31 100644
--- a/cc/trees/single_thread_proxy.h
+++ b/cc/trees/single_thread_proxy.h
@@ -175,13 +175,16 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
// code is running on the impl thread to satisfy assertion checks.
class DebugScopedSetImplThread {
public:
+#if DCHECK_IS_ON()
explicit DebugScopedSetImplThread(TaskRunnerProvider* task_runner_provider)
: task_runner_provider_(task_runner_provider) {
-#if DCHECK_IS_ON()
previous_value_ = task_runner_provider_->impl_thread_is_overridden_;
task_runner_provider_->SetCurrentThreadIsImplThread(true);
-#endif
}
+#else
+ explicit DebugScopedSetImplThread(TaskRunnerProvider* task_runner_provider) {}
+#endif
+
~DebugScopedSetImplThread() {
#if DCHECK_IS_ON()
task_runner_provider_->SetCurrentThreadIsImplThread(previous_value_);
@@ -189,8 +192,10 @@ class DebugScopedSetImplThread {
}
private:
+#if DCHECK_IS_ON()
bool previous_value_;
TaskRunnerProvider* task_runner_provider_;
+#endif
DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThread);
};
@@ -199,13 +204,16 @@ class DebugScopedSetImplThread {
// code is running on the main thread to satisfy assertion checks.
class DebugScopedSetMainThread {
public:
+#if DCHECK_IS_ON()
explicit DebugScopedSetMainThread(TaskRunnerProvider* task_runner_provider)
: task_runner_provider_(task_runner_provider) {
-#if DCHECK_IS_ON()
previous_value_ = task_runner_provider_->impl_thread_is_overridden_;
task_runner_provider_->SetCurrentThreadIsImplThread(false);
-#endif
}
+#else
+ explicit DebugScopedSetMainThread(TaskRunnerProvider* task_runner_provider) {}
+#endif
+
~DebugScopedSetMainThread() {
#if DCHECK_IS_ON()
task_runner_provider_->SetCurrentThreadIsImplThread(previous_value_);
@@ -213,8 +221,10 @@ class DebugScopedSetMainThread {
}
private:
+#if DCHECK_IS_ON()
bool previous_value_;
TaskRunnerProvider* task_runner_provider_;
+#endif
DISALLOW_COPY_AND_ASSIGN(DebugScopedSetMainThread);
};

Powered by Google App Engine
This is Rietveld 408576698