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

Side by Side Diff: content/browser/mock_resource_context.cc

Issue 9369009: Make content::ResourceContext be a real interface like the rest of the Content API (i.e. don't ha... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 10 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 | « content/browser/mock_resource_context.h ('k') | content/browser/plugin_data_remover_impl.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 "content/browser/mock_resource_context.h" 5 #include "content/browser/mock_resource_context.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "net/url_request/url_request_test_util.h" 8 #include "net/url_request/url_request_test_util.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 static base::LazyInstance<MockResourceContext> 12 static base::LazyInstance<MockResourceContext>
13 g_mock_resource_context = LAZY_INSTANCE_INITIALIZER; 13 g_mock_resource_context = LAZY_INSTANCE_INITIALIZER;
14 14
15 MockResourceContext* MockResourceContext::GetInstance() { 15 MockResourceContext* MockResourceContext::GetInstance() {
16 return &g_mock_resource_context.Get(); 16 return &g_mock_resource_context.Get();
17 } 17 }
18 18
19 MockResourceContext::MockResourceContext() 19 MockResourceContext::MockResourceContext()
20 : test_request_context_(new TestURLRequestContext) { 20 : test_request_context_(new TestURLRequestContext),
21 set_request_context(test_request_context_); 21 media_observer_(NULL),
22 media_stream_manager_(NULL),
23 audio_manager_(NULL) {
22 } 24 }
25
26 MockResourceContext::MockResourceContext(net::URLRequestContext* context)
27 : test_request_context_(context),
28 media_observer_(NULL),
29 media_stream_manager_(NULL),
30 audio_manager_(NULL) {
31 }
32
23 MockResourceContext::~MockResourceContext() {} 33 MockResourceContext::~MockResourceContext() {}
24 34
25 void MockResourceContext::EnsureInitialized() const {} 35 net::HostResolver* MockResourceContext::GetHostResolver() {
36 return NULL;
37 }
38
39 net::URLRequestContext* MockResourceContext::GetRequestContext() {
40 return test_request_context_;
41 }
42
43 ChromeAppCacheService* MockResourceContext::GetAppCacheService() {
44 return NULL;
45 }
46
47 webkit_database::DatabaseTracker* MockResourceContext::GetDatabaseTracker() {
48 return NULL;
49 }
50
51 fileapi::FileSystemContext* MockResourceContext::GetFileSystemContext() {
52 return NULL;
53 }
54
55 ChromeBlobStorageContext* MockResourceContext::GetBlobStorageContext() {
56 return NULL;
57 }
58
59 quota::QuotaManager* MockResourceContext::GetQuotaManager() {
60 return NULL;
61 }
62
63 HostZoomMap* MockResourceContext::GetHostZoomMap() {
64 return NULL;
65 }
66
67 MediaObserver* MockResourceContext::GetMediaObserver() {
68 return media_observer_;
69 }
70
71 media_stream::MediaStreamManager*
72 MockResourceContext::GetMediaStreamManager() {
73 return media_stream_manager_;
74 }
75
76 AudioManager* MockResourceContext::GetAudioManager() {
77 return audio_manager_;
78 }
26 79
27 } // namespace content 80 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mock_resource_context.h ('k') | content/browser/plugin_data_remover_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698