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

Side by Side Diff: mojo/public/cpp/bindings/tests/container_test_util.cc

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/public/cpp/bindings/tests/container_test_util.h"
6
7 namespace mojo {
8
9 size_t CopyableType::num_instances_ = 0;
10 size_t MoveOnlyType::num_instances_ = 0;
11
12 CopyableType::CopyableType() : copied_(false), ptr_(this) {
13 num_instances_++;
14 }
15
16 CopyableType::CopyableType(const CopyableType& other)
17 : copied_(true), ptr_(other.ptr()) {
18 num_instances_++;
19 }
20
21 CopyableType& CopyableType::operator=(const CopyableType& other) {
22 copied_ = true;
23 ptr_ = other.ptr();
24 return *this;
25 }
26
27 CopyableType::~CopyableType() {
28 num_instances_--;
29 }
30
31 MoveOnlyType::MoveOnlyType() : moved_(false), ptr_(this) {
32 num_instances_++;
33 }
34
35 MoveOnlyType::MoveOnlyType(MoveOnlyType&& other)
36 : moved_(true), ptr_(other.ptr()) {
37 num_instances_++;
38 }
39
40 MoveOnlyType& MoveOnlyType::operator=(MoveOnlyType&& other) {
41 moved_ = true;
42 ptr_ = other.ptr();
43 return *this;
44 }
45
46 MoveOnlyType::~MoveOnlyType() {
47 num_instances_--;
48 }
49
50 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/container_test_util.h ('k') | mojo/public/cpp/bindings/tests/equals_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698