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

Side by Side Diff: extensions/browser/extension_protocols.cc

Issue 650453003: Override IsRedirectResponse in extension protocols (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « chrome/browser/extensions/extension_resource_protocols.cc ('k') | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_protocols.h" 5 #include "extensions/browser/extension_protocols.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 directory_path_, 207 directory_path_,
208 base::Unretained(read_file_path), 208 base::Unretained(read_file_path),
209 base::Unretained(last_modified_time)), 209 base::Unretained(last_modified_time)),
210 base::Bind(&URLRequestExtensionJob::OnFilePathAndLastModifiedTimeRead, 210 base::Bind(&URLRequestExtensionJob::OnFilePathAndLastModifiedTimeRead,
211 weak_factory_.GetWeakPtr(), 211 weak_factory_.GetWeakPtr(),
212 base::Owned(read_file_path), 212 base::Owned(read_file_path),
213 base::Owned(last_modified_time))); 213 base::Owned(last_modified_time)));
214 DCHECK(posted); 214 DCHECK(posted);
215 } 215 }
216 216
217 virtual bool IsRedirectResponse(GURL* location,
218 int* http_status_code) override {
219 return false;
220 }
221
217 virtual void SetExtraRequestHeaders( 222 virtual void SetExtraRequestHeaders(
218 const net::HttpRequestHeaders& headers) override { 223 const net::HttpRequestHeaders& headers) override {
219 // TODO(asargent) - we'll need to add proper support for range headers. 224 // TODO(asargent) - we'll need to add proper support for range headers.
220 // crbug.com/369895. 225 // crbug.com/369895.
221 std::string range_header; 226 std::string range_header;
222 if (headers.GetHeader(net::HttpRequestHeaders::kRange, &range_header)) { 227 if (headers.GetHeader(net::HttpRequestHeaders::kRange, &range_header)) {
223 if (verify_job_.get()) 228 if (verify_job_.get())
224 verify_job_ = NULL; 229 verify_job_ = NULL;
225 } 230 }
226 URLRequestFileJob::SetExtraRequestHeaders(headers); 231 URLRequestFileJob::SetExtraRequestHeaders(headers);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 return new net::HttpResponseHeaders(raw_headers); 556 return new net::HttpResponseHeaders(raw_headers);
552 } 557 }
553 558
554 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( 559 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler(
555 bool is_incognito, 560 bool is_incognito,
556 extensions::InfoMap* extension_info_map) { 561 extensions::InfoMap* extension_info_map) {
557 return new ExtensionProtocolHandler(is_incognito, extension_info_map); 562 return new ExtensionProtocolHandler(is_incognito, extension_info_map);
558 } 563 }
559 564
560 } // namespace extensions 565 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_resource_protocols.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698