Commit f1f3cb1d authored by Daniel Cheng's avatar Daniel Cheng

Remove Pass() on Linux.

Pass() is a legacy of the original C++03 move emulation implementation.
New code should use std::move from <utility>. ChromeOS is exempt until the
migration there is complete.

❆(੭ु ◜◡‾)੭ु⁾❆

BUG=557422
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1548273002 .

Cr-Commit-Position: refs/heads/master@{#367177}
parent ac4d93be
......@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
......@@ -401,6 +402,7 @@ TEST(ScopedPtrTest, MoveBehavior) {
EXPECT_TRUE(scoper3.get());
}
#if !(defined(OS_LINUX) && !defined(OS_CHROMEOS))
// Test uncaught Pass() does not have side effects, because Pass()
// is implemented by std::move().
// TODO(danakj): Remove this test case when we remove Pass().
......@@ -416,6 +418,7 @@ TEST(ScopedPtrTest, MoveBehavior) {
EXPECT_TRUE(rvalue);
}
EXPECT_EQ(0, constructed);
#endif
// Test that passing to function which does nothing does not leak.
{
......
......@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "build/build_config.h"
// TODO(crbug.com/566182): DEPRECATED!
// Use DISALLOW_COPY_AND_ASSIGN instead, or if your type will be used in
......@@ -30,6 +31,17 @@
// for more details.
// TODO(crbug.com/566182): Remove this macro and use DISALLOW_COPY_AND_ASSIGN
// everywhere instead.
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
#define DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(type) \
private: \
type(const type&) = delete; \
void operator=(const type&) = delete; \
\
public: \
typedef void MoveOnlyTypeForCPP03; \
\
private:
#else
#define DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(type) \
private: \
type(const type&) = delete; \
......@@ -40,5 +52,6 @@
typedef void MoveOnlyTypeForCPP03; \
\
private:
#endif
#endif // BASE_MOVE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment