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

Side by Side Diff: net/url_request/url_request_file_job_unittest.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
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 "net/url_request/url_request_file_job.h" 5 #include "net/url_request/url_request_file_job.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 NetworkDelegate* network_delegate) const override { 75 NetworkDelegate* network_delegate) const override {
76 URLRequestFileJobWithCallbacks* job = new URLRequestFileJobWithCallbacks( 76 URLRequestFileJobWithCallbacks* job = new URLRequestFileJobWithCallbacks(
77 request, 77 request,
78 network_delegate, 78 network_delegate,
79 path_, 79 path_,
80 base::MessageLoop::current()->message_loop_proxy()); 80 base::MessageLoop::current()->message_loop_proxy());
81 observer_->OnJobCreated(job); 81 observer_->OnJobCreated(job);
82 return job; 82 return job;
83 } 83 }
84 84
85 net::URLRequestJob* MaybeInterceptRedirect(
86 net::URLRequest* request,
87 net::NetworkDelegate* network_delegate,
88 const GURL& location) const override {
89 return nullptr;
90 }
91
92 net::URLRequestJob* MaybeInterceptResponse(
93 net::URLRequest* request,
94 net::NetworkDelegate* network_delegate) const override {
95 return nullptr;
96 }
97
85 bool IsHandledProtocol(const std::string& scheme) const override { 98 bool IsHandledProtocol(const std::string& scheme) const override {
86 return scheme == "file"; 99 return scheme == "file";
87 } 100 }
88 101
89 bool IsHandledURL(const GURL& url) const override { 102 bool IsHandledURL(const GURL& url) const override {
90 return IsHandledProtocol(url.scheme()); 103 return IsHandledProtocol(url.scheme());
91 } 104 }
92 105
93 bool IsSafeRedirectTarget(const GURL& location) const override { 106 bool IsSafeRedirectTarget(const GURL& location) const override {
94 return false; 107 return false;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // Use a 15KB content file and read a range chosen somewhat arbitrarily but 260 // Use a 15KB content file and read a range chosen somewhat arbitrarily but
248 // not aligned on any likely page boundaries. 261 // not aligned on any likely page boundaries.
249 int size = 15 * 1024; 262 int size = 15 * 1024;
250 Range range(1701, (6 * 1024) + 3); 263 Range range(1701, (6 * 1024) + 3);
251 RunRequest(MakeContentOfSize(size), &range); 264 RunRequest(MakeContentOfSize(size), &range);
252 } 265 }
253 266
254 } // namespace 267 } // namespace
255 268
256 } // namespace net 269 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context_builder.cc ('k') | net/url_request/url_request_intercepting_job_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698