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

Side by Side Diff: chrome/test/test_url_request_context_getter.h

Issue 6056007: net: Add namespace net to the remaining files under url_request directory. (Closed)
Patch Set: chromeos fixes Created 9 years, 11 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
« no previous file with comments | « chrome/test/automation/automation_proxy_uitest.h ('k') | chrome_frame/cfproxy.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) 2010 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 #ifndef CHROME_TEST_TEST_URL_REQUEST_CONTEXT_GETTER_H_ 5 #ifndef CHROME_TEST_TEST_URL_REQUEST_CONTEXT_GETTER_H_
6 #define CHROME_TEST_TEST_URL_REQUEST_CONTEXT_GETTER_H_ 6 #define CHROME_TEST_TEST_URL_REQUEST_CONTEXT_GETTER_H_
7 #pragma once
7 8
8 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
9 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
10 #include "chrome/common/net/url_request_context_getter.h" 11 #include "chrome/common/net/url_request_context_getter.h"
11 #include "net/url_request/url_request_unittest.h" 12 #include "net/url_request/url_request_unittest.h"
12 13
13 // Used to return a dummy context (normally the context is on the IO thread). 14 // Used to return a dummy context (normally the context is on the IO thread).
14 // The one here can be run on the main test thread. Note that this can lead to 15 // The one here can be run on the main test thread. Note that this can lead to
15 // a leak if your test does not have a BrowserThread::IO in it because 16 // a leak if your test does not have a BrowserThread::IO in it because
16 // URLRequestContextGetter is defined as a ReferenceCounted object with a 17 // URLRequestContextGetter is defined as a ReferenceCounted object with a
17 // special trait that deletes it on the IO thread. 18 // special trait that deletes it on the IO thread.
18 class TestURLRequestContextGetter : public URLRequestContextGetter { 19 class TestURLRequestContextGetter : public URLRequestContextGetter {
19 public: 20 public:
20 virtual URLRequestContext* GetURLRequestContext() { 21 virtual net::URLRequestContext* GetURLRequestContext() {
21 if (!context_) 22 if (!context_)
22 context_ = new TestURLRequestContext(); 23 context_ = new TestURLRequestContext();
23 return context_.get(); 24 return context_.get();
24 } 25 }
25 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const { 26 virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
26 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 27 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
27 } 28 }
28 29
29 private: 30 private:
30 scoped_refptr<URLRequestContext> context_; 31 scoped_refptr<net::URLRequestContext> context_;
31 }; 32 };
32 33
33 #endif // CHROME_TEST_TEST_URL_REQUEST_CONTEXT_GETTER_H_ 34 #endif // CHROME_TEST_TEST_URL_REQUEST_CONTEXT_GETTER_H_
OLDNEW
« no previous file with comments | « chrome/test/automation/automation_proxy_uitest.h ('k') | chrome_frame/cfproxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698