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

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

Issue 7397008: Deprecate RegisterProtocolFactory/(Un)RegisterInterceptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent. Created 9 years, 5 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) 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 "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/threading/thread_restrictions.h" 8 #include "base/threading/thread_restrictions.h"
9 #include "content/browser/browser_thread.h" 9 #include "content/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 13 matching lines...) Expand all
24 } 24 }
25 25
26 virtual int GetResponseCode() const { return 200; } 26 virtual int GetResponseCode() const { return 200; }
27 27
28 private: 28 private:
29 ~AutoUpdateTestRequestJob() {} 29 ~AutoUpdateTestRequestJob() {}
30 }; 30 };
31 31
32 32
33 AutoUpdateInterceptor::AutoUpdateInterceptor() { 33 AutoUpdateInterceptor::AutoUpdateInterceptor() {
34 net::URLRequest::RegisterRequestInterceptor(this); 34 net::URLRequest::Deprecated::RegisterRequestInterceptor(this);
35 } 35 }
36 36
37 AutoUpdateInterceptor::~AutoUpdateInterceptor() { 37 AutoUpdateInterceptor::~AutoUpdateInterceptor() {
38 net::URLRequest::UnregisterRequestInterceptor(this); 38 net::URLRequest::Deprecated::UnregisterRequestInterceptor(this);
39 } 39 }
40 40
41 net::URLRequestJob* AutoUpdateInterceptor::MaybeIntercept( 41 net::URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(
42 net::URLRequest* request) { 42 net::URLRequest* request) {
43 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 43 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
44 if (request->url().scheme() != "http" || 44 if (request->url().scheme() != "http" ||
45 request->url().host() != "localhost") { 45 request->url().host() != "localhost") {
46 return NULL; 46 return NULL;
47 } 47 }
48 48
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 responses_[gurl] = path; 81 responses_[gurl] = path;
82 } 82 }
83 83
84 84
85 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url, 85 void AutoUpdateInterceptor::SetResponseOnIOThread(const std::string url,
86 const FilePath& path) { 86 const FilePath& path) {
87 BrowserThread::PostTask( 87 BrowserThread::PostTask(
88 BrowserThread::IO, FROM_HERE, 88 BrowserThread::IO, FROM_HERE,
89 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path)); 89 NewRunnableMethod(this, &AutoUpdateInterceptor::SetResponse, url, path));
90 } 90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698