| Index: third_party/WebKit/Source/platform/threading/BindForMojo.h
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/EditingState.cpp b/third_party/WebKit/Source/platform/threading/BindForMojo.h
|
| similarity index 23%
|
| copy from third_party/WebKit/Source/core/editing/commands/EditingState.cpp
|
| copy to third_party/WebKit/Source/platform/threading/BindForMojo.h
|
| index 03da028b0170ad5499db9c1e9f60c2c589cde1ce..d0a6a550240e4d808f79a29a39d8c6539f600dfb 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/EditingState.cpp
|
| +++ b/third_party/WebKit/Source/platform/threading/BindForMojo.h
|
| @@ -2,45 +2,28 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "core/editing/commands/EditingState.h"
|
| +#ifndef BindForMojo_h
|
| +#define BindForMojo_h
|
|
|
| -namespace blink {
|
| -
|
| -EditingState::EditingState()
|
| -{
|
| -}
|
| -
|
| -EditingState::~EditingState()
|
| -{
|
| -}
|
| +#include "base/bind.h"
|
| +#include "mojo/public/cpp/bindings/callback.h"
|
|
|
| -void EditingState::abort()
|
| -{
|
| - ASSERT(!m_isAborted);
|
| - m_isAborted = true;
|
| -}
|
| +// This file provides limited access to base::Bind() function. base::Bind()
|
| +// could be dangerous if it's used across threads, so we don't want to allow
|
| +// general use of base::Bind().
|
| +// See also "platform/ThreadSafeFunctional.h".
|
|
|
| -// ---
|
| -IgnorableEditingAbortState::IgnorableEditingAbortState()
|
| -{
|
| -}
|
| -
|
| -IgnorableEditingAbortState::~IgnorableEditingAbortState()
|
| -{
|
| -}
|
| -
|
| -#if ENABLE(ASSERT)
|
| -// ---
|
| -
|
| -NoEditingAbortChecker::NoEditingAbortChecker(const char* file, int line)
|
| - : m_file(file)
|
| - , m_line(line) { }
|
| +namespace blink {
|
|
|
| -NoEditingAbortChecker::~NoEditingAbortChecker()
|
| +// Binds an instance of a class to its member function. Does not bind anything
|
| +// else.
|
| +template<typename Class, typename ReturnType, typename... Args>
|
| +mojo::Callback<ReturnType(Args...)>
|
| +sameThreadBindForMojo(ReturnType (Class::*method)(Args...), Class* instance)
|
| {
|
| - ASSERT_AT(!m_editingState.isAborted(), m_file, m_line, "");
|
| + return base::Bind(method, base::Unretained(instance));
|
| }
|
|
|
| -#endif
|
| -
|
| } // namespace blink
|
| +
|
| +#endif // BindForMojo_h
|
|
|