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

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

Issue 11663003: Make ProtocolHandlerRegistry use 307 to redirect instead of 302. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | 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) 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 155 net::URLRequestRedirectJob::REDIRECT_307_TEMPORARY_REDIRECT);
156 } 156 }
157 157
158 // URLInterceptor ------------------------------------------------------------ 158 // URLInterceptor ------------------------------------------------------------
159 159
160 // Instances of this class are produced for ownership by the IO 160 // Instances of this class are produced for ownership by the IO
161 // thread where it handler URL requests. We should never hold 161 // thread where it handler URL requests. We should never hold
162 // any pointers on this class, only produce them in response to 162 // any pointers on this class, only produce them in response to
163 // requests via |ProtocolHandlerRegistry::CreateURLInterceptor|. 163 // requests via |ProtocolHandlerRegistry::CreateURLInterceptor|.
164 class ProtocolHandlerRegistry::URLInterceptor 164 class ProtocolHandlerRegistry::URLInterceptor
165 : public net::URLRequestJobFactory::Interceptor { 165 : public net::URLRequestJobFactory::Interceptor {
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 } 875 }
876 876
877 net::URLRequestJobFactory::Interceptor* 877 net::URLRequestJobFactory::Interceptor*
878 ProtocolHandlerRegistry::CreateURLInterceptor() { 878 ProtocolHandlerRegistry::CreateURLInterceptor() {
879 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 879 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
880 // 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
881 // InitializeOnUIThread. Any method calls must be done 881 // InitializeOnUIThread. Any method calls must be done
882 // on the IO thread (this is checked). 882 // on the IO thread (this is checked).
883 return new URLInterceptor(core_); 883 return new URLInterceptor(core_);
884 } 884 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698