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

Side by Side Diff: content/test/mock_resource_context.h

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_ 5 #ifndef CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
6 #define CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_ 6 #define CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/scoped_ptr.h"
eroman 2012/05/04 04:27:02 Is this header needed?
12 #include "content/public/browser/resource_context.h" 12 #include "content/public/browser/resource_context.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class MockResourceContext : public ResourceContext { 16 class MockResourceContext : public ResourceContext {
17 public: 17 public:
18 MockResourceContext(); 18 MockResourceContext();
19 explicit MockResourceContext(net::URLRequestContext* context); 19 explicit MockResourceContext(net::URLRequestContext* context);
20 virtual ~MockResourceContext(); 20 virtual ~MockResourceContext();
21 21
22 void set_request_context(net::URLRequestContext* context) { 22 void set_request_context(net::URLRequestContext* context) {
23 test_request_context_ = context; 23 test_request_context_ = context;
24 } 24 }
25 25
26 // ResourceContext implementation: 26 // ResourceContext implementation:
27 virtual net::HostResolver* GetHostResolver() OVERRIDE; 27 virtual net::HostResolver* GetHostResolver() OVERRIDE;
28 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; 28 virtual net::URLRequestContext* GetRequestContext() OVERRIDE;
29 29
30 private: 30 private:
31 scoped_refptr<net::URLRequestContext> test_request_context_; 31 net::URLRequestContext* test_request_context_;
32 32
33 DISALLOW_COPY_AND_ASSIGN(MockResourceContext); 33 DISALLOW_COPY_AND_ASSIGN(MockResourceContext);
34 }; 34 };
35 35
36 } // namespace content 36 } // namespace content
37 37
38 #endif // CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_ 38 #endif // CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698