Index: content/test/layout_tests/runner/MockColorChooser.h |
diff --git a/third_party/tcmalloc/chromium/src/base/spinlock_internal.h b/content/test/layout_tests/runner/MockColorChooser.h |
similarity index 54% |
copy from third_party/tcmalloc/chromium/src/base/spinlock_internal.h |
copy to content/test/layout_tests/runner/MockColorChooser.h |
index 44942609f40a87492a7aeed0068a5e27bf9cd157..336264cfb8381fbca4a8c1c92dd112690909d834 100644 |
--- a/third_party/tcmalloc/chromium/src/base/spinlock_internal.h |
+++ b/content/test/layout_tests/runner/MockColorChooser.h |
@@ -1,5 +1,9 @@ |
-/* Copyright (c) 2010, Google Inc. |
- * All rights reserved. |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+/* |
+ * Copyright (C) 2013 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -26,39 +30,39 @@ |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- * |
- * --- |
- * This file is an internal part spinlock.cc and once.cc |
- * It may not be used directly by code outside of //base. |
*/ |
-#ifndef BASE_SPINLOCK_INTERNAL_H_ |
-#define BASE_SPINLOCK_INTERNAL_H_ |
+#ifndef MockColorChooser_h |
+#define MockColorChooser_h |
+ |
+#include "content/public/test/layout_tests/WebTask.h" |
+#include "content/test/layout_tests/runner/TestCommon.h" |
+#include "third_party/WebKit/public/platform/WebNonCopyable.h" |
+#include "third_party/WebKit/public/web/WebColorChooser.h" |
+#include "third_party/WebKit/public/web/WebColorChooserClient.h" |
+ |
+namespace WebTestRunner { |
-#include <config.h> |
-#include "base/basictypes.h" |
-#include "base/atomicops.h" |
+class WebTestDelegate; |
+class WebTestProxyBase; |
+class MockColorChooser : public blink::WebColorChooser, public blink::WebNonCopyable { |
+public: |
+ MockColorChooser(blink::WebColorChooserClient*, WebTestDelegate*, WebTestProxyBase*); |
+ virtual ~MockColorChooser(); |
-namespace base { |
-namespace internal { |
+ // blink::WebColorChooser implementation. |
+ virtual void setSelectedColor(const blink::WebColor) OVERRIDE; |
+ virtual void endChooser() OVERRIDE; |
-// SpinLockWait() waits until it can perform one of several transitions from |
-// "from" to "to". It returns when it performs a transition where done==true. |
-struct SpinLockWaitTransition { |
- int32 from; |
- int32 to; |
- bool done; |
+ void invokeDidEndChooser(); |
+ WebTaskList* taskList() { return &m_taskList; } |
+private: |
+ blink::WebColorChooserClient* m_client; |
+ WebTestDelegate* m_delegate; |
+ WebTestProxyBase* m_proxy; |
+ WebTaskList m_taskList; |
}; |
-// Wait until *w can transition from trans[i].from to trans[i].to for some i |
-// satisfying 0<=i<n && trans[i].done, atomically make the transition, |
-// then return the old value of *w. Make any other atomic tranistions |
-// where !trans[i].done, but continue waiting. |
-int32 SpinLockWait(volatile Atomic32 *w, int n, |
- const SpinLockWaitTransition trans[]); |
-void SpinLockWake(volatile Atomic32 *w, bool all); |
-void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop); |
+} |
-} // namespace internal |
-} // namespace base |
-#endif |
+#endif // MockColorChooser_h |