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

Unified Diff: third_party/WebKit/public/platform/callback/WebClosure.h

Issue 1882503002: Remove setErrorMessageCallback from WebGraphicsContext3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@errorcallback
Patch Set: weberrors: rebase Created 4 years, 8 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: third_party/WebKit/public/platform/callback/WebClosure.h
diff --git a/third_party/WebKit/public/platform/callback/WebClosure.h b/third_party/WebKit/public/platform/callback/WebClosure.h
deleted file mode 100644
index 5666e3f2de8f0cd12578e51d9f31cbc2c45ea81a..0000000000000000000000000000000000000000
--- a/third_party/WebKit/public/platform/callback/WebClosure.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2016 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.
-
-#ifndef WebClosure_h
-#define WebClosure_h
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/callback_helpers.h"
-#include "base/macros.h"
-#include "base/memory/ptr_util.h"
-#include "public/platform/WebCommon.h"
-
-#include <memory>
-#include <utility>
-
-#if BLINK_IMPLEMENTATION
-#include "wtf/Functional.h"
-#else
-#include "base/logging.h"
-#endif
-
-namespace blink {
-
-// Conversion from WTF closures to base closures to pass a callback out of
-// blink.
-class WebClosure {
-public:
-#if BLINK_IMPLEMENTATION
- WebClosure() {}
-
- explicit WebClosure(PassOwnPtr<SameThreadClosure> c)
- {
- m_closure = base::Bind(&RunAndDelete, base::Passed(base::WrapUnique(c.leakPtr())));
- }
-#endif
-
- // TODO(danakj): These could be =default with MSVC 2015.
- WebClosure(WebClosure&& other) { *this = std::move(other); }
- WebClosure& operator=(WebClosure&& other)
- {
-#if DCHECK_IS_ON()
- m_haveClosure = other.m_haveClosure;
- other.m_haveClosure = false;
-#endif
- m_closure = std::move(other.m_closure);
- return *this;
- }
-
-#if !BLINK_IMPLEMENTATION
- // TODO(danakj): This could be rvalue-ref-qualified.
- base::Closure TakeBaseClosure()
- {
-#if DCHECK_IS_ON()
- // Don't call this more than once!
- DCHECK(m_haveClosure);
- m_haveClosure = false;
-#endif
- return std::move(m_closure);
- }
-#endif
-
-private:
-#if BLINK_IMPLEMENTATION
- static void RunAndDelete(std::unique_ptr<SameThreadClosure> c) { (*c)(); }
-#endif
-
-#if DCHECK_IS_ON()
- bool m_haveClosure = true;
-#endif
- base::Closure m_closure;
-
- DISALLOW_COPY_AND_ASSIGN(WebClosure);
-};
-
-} // namespace blink
-
-#endif // WebClosure_h

Powered by Google App Engine
This is Rietveld 408576698