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

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry.cc

Issue 11420013: POSTs to HSTS domains are no longer converted to GETs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix stuff Created 8 years, 1 month 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/custom_handlers/protocol_handler_registry.h" 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 ProtocolHandler handler = LookupHandler(default_handlers_, 144 ProtocolHandler handler = LookupHandler(default_handlers_,
145 request->url().scheme()); 145 request->url().scheme());
146 if (handler.IsEmpty()) 146 if (handler.IsEmpty())
147 return NULL; 147 return NULL;
148 148
149 GURL translated_url(handler.TranslateUrl(request->url())); 149 GURL translated_url(handler.TranslateUrl(request->url()));
150 if (!translated_url.is_valid()) 150 if (!translated_url.is_valid())
151 return NULL; 151 return NULL;
152 152
153 return new net::URLRequestRedirectJob( 153 return new net::URLRequestRedirectJob(
154 request, network_delegate, translated_url); 154 request, network_delegate, translated_url,
155 net::URLRequestRedirectJob::REDIRECT_302_FOUND);
willchan no longer on Chromium 2012/11/17 21:43:08 I think you're right that this is wrong. May want
mmenke 2012/11/19 16:00:35 Bug filed - http://www.crbug.com/161769
155 } 156 }
156 157
157 // URLInterceptor ------------------------------------------------------------ 158 // URLInterceptor ------------------------------------------------------------
158 159
159 // Instances of this class are produced for ownership by the IO 160 // Instances of this class are produced for ownership by the IO
160 // thread where it handler URL requests. We should never hold 161 // thread where it handler URL requests. We should never hold
161 // any pointers on this class, only produce them in response to 162 // any pointers on this class, only produce them in response to
162 // requests via |ProtocolHandlerRegistry::CreateURLInterceptor|. 163 // requests via |ProtocolHandlerRegistry::CreateURLInterceptor|.
163 class ProtocolHandlerRegistry::URLInterceptor 164 class ProtocolHandlerRegistry::URLInterceptor
164 : public net::URLRequestJobFactory::Interceptor { 165 : public net::URLRequestJobFactory::Interceptor {
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 } 875 }
875 876
876 net::URLRequestJobFactory::Interceptor* 877 net::URLRequestJobFactory::Interceptor*
877 ProtocolHandlerRegistry::CreateURLInterceptor() { 878 ProtocolHandlerRegistry::CreateURLInterceptor() {
878 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 879 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
879 // this is always created on the UI thread (in profile_io's 880 // this is always created on the UI thread (in profile_io's
880 // InitializeOnUIThread. Any method calls must be done 881 // InitializeOnUIThread. Any method calls must be done
881 // on the IO thread (this is checked). 882 // on the IO thread (this is checked).
882 return new URLInterceptor(core_); 883 return new URLInterceptor(core_);
883 } 884 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698