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

Side by Side Diff: chrome/browser/extensions/autoupdate_interceptor.cc

Issue 5607004: net: Remove typedef net::URLRequestJob URLRequestJob; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 2 Created 10 years 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/extensions/autoupdate_interceptor.h" 5 #include "chrome/browser/extensions/autoupdate_interceptor.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/thread_restrictions.h" 8 #include "base/thread_restrictions.h"
9 #include "chrome/browser/browser_thread.h" 9 #include "chrome/browser/browser_thread.h"
10 #include "net/url_request/url_request_test_job.h" 10 #include "net/url_request/url_request_test_job.h"
(...skipping 15 matching lines...) Expand all
26 26
27 27
28 AutoUpdateInterceptor::AutoUpdateInterceptor() { 28 AutoUpdateInterceptor::AutoUpdateInterceptor() {
29 net::URLRequest::RegisterRequestInterceptor(this); 29 net::URLRequest::RegisterRequestInterceptor(this);
30 } 30 }
31 31
32 AutoUpdateInterceptor::~AutoUpdateInterceptor() { 32 AutoUpdateInterceptor::~AutoUpdateInterceptor() {
33 net::URLRequest::UnregisterRequestInterceptor(this); 33 net::URLRequest::UnregisterRequestInterceptor(this);
34 } 34 }
35 35
36 URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(net::URLRequest* request) { 36 net::URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(
37 net::URLRequest* request) {
37 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 38 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
38 if (request->url().scheme() != "http" || 39 if (request->url().scheme() != "http" ||
39 request->url().host() != "localhost") { 40 request->url().host() != "localhost") {
40 return NULL; 41 return NULL;
41 } 42 }
42 43
43 // It's ok to do a blocking disk access on this thread; this class 44 // It's ok to do a blocking disk access on this thread; this class
44 // is just used for tests. 45 // is just used for tests.
45 base::ThreadRestrictions::ScopedAllowIO allow_io; 46 base::ThreadRestrictions::ScopedAllowIO allow_io;
46 47
(...skipping 28 matching lines...) Expand all
75 responses_[gurl] = path; 76 responses_[gurl] = path;
76 } 77 }
77 78
78 79
79 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url, 80 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url,
80 const FilePath& path) { 81 const FilePath& path) {
81 BrowserThread::PostTask( 82 BrowserThread::PostTask(
82 BrowserThread::IO, FROM_HERE, 83 BrowserThread::IO, FROM_HERE,
83 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path)); 84 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path));
84 } 85 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/mediaplayer_ui.cc ('k') | chrome/browser/extensions/extension_protocols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698