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

Side by Side Diff: media/base/mock_callback.cc

Issue 10067035: RefCounted types should not have public destructors, media/ and gpu/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « media/base/mock_callback.h ('k') | media/base/stream_parser_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/mock_callback.h" 5 #include "media/base/mock_callback.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 8
9 using ::testing::_; 9 using ::testing::_;
10 using ::testing::StrictMock; 10 using ::testing::StrictMock;
11 11
12 namespace media { 12 namespace media {
13 13
14 MockClosure::MockClosure() {} 14 MockClosure::MockClosure() {}
15 MockClosure::~MockClosure() {} 15 MockClosure::~MockClosure() {}
16 16
17 base::Closure NewExpectedClosure() { 17 base::Closure NewExpectedClosure() {
18 StrictMock<MockClosure>* callback = new StrictMock<MockClosure>(); 18 StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
19 EXPECT_CALL(*callback, Run()); 19 EXPECT_CALL(*callback, Run());
20 return base::Bind(&MockClosure::Run, callback); 20 return base::Bind(&MockClosure::Run, callback);
21 } 21 }
22 22
23 class MockStatusCB : public base::RefCountedThreadSafe<MockStatusCB> { 23 class MockStatusCB : public base::RefCountedThreadSafe<MockStatusCB> {
24 public: 24 public:
25 MockStatusCB() {} 25 MockStatusCB() {}
26 MOCK_METHOD1(Run, void(PipelineStatus));
27
28 protected:
29 friend class base::RefCountedThreadSafe<MockStatusCB>;
26 virtual ~MockStatusCB() {} 30 virtual ~MockStatusCB() {}
27 MOCK_METHOD1(Run, void(PipelineStatus)); 31
28 private: 32 private:
29 DISALLOW_COPY_AND_ASSIGN(MockStatusCB); 33 DISALLOW_COPY_AND_ASSIGN(MockStatusCB);
30 }; 34 };
31 35
32 base::Callback<void(PipelineStatus)> NewExpectedStatusCB( 36 base::Callback<void(PipelineStatus)> NewExpectedStatusCB(
33 PipelineStatus status) { 37 PipelineStatus status) {
34 StrictMock<MockStatusCB>* callback = new StrictMock<MockStatusCB>(); 38 StrictMock<MockStatusCB>* callback = new StrictMock<MockStatusCB>();
35 EXPECT_CALL(*callback, Run(status)); 39 EXPECT_CALL(*callback, Run(status));
36 return base::Bind(&MockStatusCB::Run, callback); 40 return base::Bind(&MockStatusCB::Run, callback);
37 } 41 }
38 42
39 } // namespace media 43 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mock_callback.h ('k') | media/base/stream_parser_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698