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

Unified Diff: Source/platform/TaskSynchronizer.cpp

Issue 198673002: Rename DatabaseTaskSynchronizer to TaskSynchronizer and move it to platform/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/platform/TaskSynchronizer.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/TaskSynchronizer.cpp
diff --git a/Source/core/accessibility/AXSVGRoot.cpp b/Source/platform/TaskSynchronizer.cpp
similarity index 66%
copy from Source/core/accessibility/AXSVGRoot.cpp
copy to Source/platform/TaskSynchronizer.cpp
index 7c2efa2cc2e7149c76eef89f21f5e3a3d61f57e0..01680215bf691d0f2f2da7a2b2e39f64dea2f9f9 100644
--- a/Source/core/accessibility/AXSVGRoot.cpp
+++ b/Source/platform/TaskSynchronizer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,35 +27,37 @@
*/
#include "config.h"
-#include "core/accessibility/AXSVGRoot.h"
+#include "platform/TaskSynchronizer.h"
+#include "heap/Handle.h"
namespace WebCore {
-AXSVGRoot::AXSVGRoot(RenderObject* renderer)
tkent 2014/03/13 07:43:51 Git chose a wrong copy source. We should land a CL
- : AXRenderObject(renderer)
- , m_parent(0)
+TaskSynchronizer::TaskSynchronizer()
+ : m_taskCompleted(false)
+#ifndef NDEBUG
+ , m_hasCheckedForTermination(false)
+#endif
{
}
-AXSVGRoot::~AXSVGRoot()
+void TaskSynchronizer::waitForTaskCompletion()
{
+ // Prevent the deadlock between park request by other threads and blocking
+ // by m_synchronousCondition.
+ ThreadState::SafePointScope scope(ThreadState::HeapPointersOnStack);
+ m_synchronousMutex.lock();
+ while (!m_taskCompleted)
+ m_synchronousCondition.wait(m_synchronousMutex);
+ m_synchronousMutex.unlock();
}
-PassRefPtr<AXSVGRoot> AXSVGRoot::create(RenderObject* renderer)
+void TaskSynchronizer::taskCompleted()
{
- return adoptRef(new AXSVGRoot(renderer));
+ m_synchronousMutex.lock();
+ m_taskCompleted = true;
+ m_synchronousCondition.signal();
+ m_synchronousMutex.unlock();
}
-AXObject* AXSVGRoot::parentObject() const
-{
- // If a parent was set because this is a remote SVG resource, use that
- // but otherwise, we should rely on the standard render tree for the parent.
- if (m_parent)
- return m_parent;
-
- return AXRenderObject::parentObject();
-}
-
-
} // namespace WebCore
« no previous file with comments | « Source/platform/TaskSynchronizer.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698