Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / tools / clang / rewrite_scoped_refptr / tests / test9-original.cc
blobe59ed6e9e10a82dced821bf27325fedea8609045
1 // Copyright (c) 2013 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.
5 #include "scoped_refptr.h"
7 struct Foo {
8 int dummy;
9 };
11 struct HasAScopedRefptr {
12 scoped_refptr<Foo> member;
14 const scoped_refptr<Foo>& GetMemberAsScopedRefptr() const { return member; }
16 Foo* GetMemberAsRawPtr() const { return member; }
19 void ExpectsRawPtr(Foo* param) {
20 Foo* temp = param;
23 void ExpectsScopedRefptr(const scoped_refptr<Foo>& param) {
24 Foo* temp = param.get();
27 void CallsRawWithMemberScopedRefptr() {
28 HasAScopedRefptr object;
29 ExpectsRawPtr(object.GetMemberAsScopedRefptr());
32 void CallsRawWithMemberRawPtr() {
33 HasAScopedRefptr object;
34 ExpectsRawPtr(object.GetMemberAsRawPtr());
37 void CallsScopedWithMemberScopedRefptr() {
38 HasAScopedRefptr object;
39 ExpectsScopedRefptr(object.GetMemberAsScopedRefptr());
42 void CallsScopedWithMemberRawPtr() {
43 HasAScopedRefptr object;
44 ExpectsScopedRefptr(object.GetMemberAsScopedRefptr());