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

Side by Side Diff: chrome/browser/component_updater/component_updater_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 #include "chrome/browser/component_updater/component_updater_interceptor.h" 4 #include "chrome/browser/component_updater/component_updater_interceptor.h"
5 5
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/threading/thread_restrictions.h" 7 #include "base/threading/thread_restrictions.h"
8 #include "content/browser/browser_thread.h" 8 #include "content/browser/browser_thread.h"
9 #include "net/url_request/url_request_test_job.h" 9 #include "net/url_request/url_request_test_job.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 ComponentUpdateInterceptor::ComponentUpdateInterceptor() { 12 ComponentUpdateInterceptor::ComponentUpdateInterceptor() {
13 net::URLRequest::RegisterRequestInterceptor(this); 13 net::URLRequest::Deprecated::RegisterRequestInterceptor(this);
14 } 14 }
15 15
16 ComponentUpdateInterceptor::~ComponentUpdateInterceptor() { 16 ComponentUpdateInterceptor::~ComponentUpdateInterceptor() {
17 net::URLRequest::UnregisterRequestInterceptor(this); 17 net::URLRequest::Deprecated::UnregisterRequestInterceptor(this);
18 } 18 }
19 19
20 net::URLRequestJob* ComponentUpdateInterceptor::MaybeIntercept( 20 net::URLRequestJob* ComponentUpdateInterceptor::MaybeIntercept(
21 net::URLRequest* request) { 21 net::URLRequest* request) {
22 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); 22 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
23 if (request->url().scheme() != "http" || 23 if (request->url().scheme() != "http" ||
24 request->url().host() != "localhost") { 24 request->url().host() != "localhost") {
25 return NULL; 25 return NULL;
26 } 26 }
27 27
(...skipping 22 matching lines...) Expand all
50 // It's ok to do a blocking disk access on this thread; this class 50 // It's ok to do a blocking disk access on this thread; this class
51 // is just used for tests. 51 // is just used for tests.
52 base::ThreadRestrictions::ScopedAllowIO allow_io; 52 base::ThreadRestrictions::ScopedAllowIO allow_io;
53 GURL gurl(url); 53 GURL gurl(url);
54 EXPECT_EQ("http", gurl.scheme()); 54 EXPECT_EQ("http", gurl.scheme());
55 EXPECT_EQ("localhost", gurl.host()); 55 EXPECT_EQ("localhost", gurl.host());
56 EXPECT_TRUE(file_util::PathExists(path)); 56 EXPECT_TRUE(file_util::PathExists(path));
57 Response response = { path, headers }; 57 Response response = { path, headers };
58 responses_[gurl] = response; 58 responses_[gurl] = response;
59 } 59 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/url_request_automation_job.cc ('k') | chrome/browser/extensions/autoupdate_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698