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

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

Issue 1128083003: Converted bare pointer to scoped_ptr in net/url_request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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 "net/url_request/url_request_job.h" 5 #include "net/url_request/url_request_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/power_monitor/power_monitor.h" 10 #include "base/power_monitor/power_monitor.h"
11 #include "base/profiler/scoped_tracker.h" 11 #include "base/profiler/scoped_tracker.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "net/base/auth.h" 15 #include "net/base/auth.h"
16 #include "net/base/host_port_pair.h" 16 #include "net/base/host_port_pair.h"
17 #include "net/base/io_buffer.h" 17 #include "net/base/io_buffer.h"
18 #include "net/base/load_states.h" 18 #include "net/base/load_states.h"
19 #include "net/base/net_errors.h" 19 #include "net/base/net_errors.h"
20 #include "net/base/network_delegate.h" 20 #include "net/base/network_delegate.h"
21 #include "net/filter/filter.h" 21 #include "net/filter/filter.h"
22 #include "net/http/http_response_headers.h" 22 #include "net/http/http_response_headers.h"
23 23
24 namespace net { 24 namespace net {
25 25
26 namespace { 26 namespace {
27 27
28 // Callback for TYPE_URL_REQUEST_FILTERS_SET net-internals event. 28 // Callback for TYPE_URL_REQUEST_FILTERS_SET net-internals event.
29 base::Value* FiltersSetCallback(Filter* filter, 29 base::Value* FiltersSetCallback(Filter* filter,
eroman 2015/05/08 18:59:47 Same thing here
payal.pandey 2015/05/11 12:24:23 As FiltersSetCallback is not single argument funct
30 NetLogCaptureMode /* capture_mode */) { 30 NetLogCaptureMode /* capture_mode */) {
31 base::DictionaryValue* event_params = new base::DictionaryValue(); 31 scoped_ptr<base::DictionaryValue> event_params(new base::DictionaryValue());
32 event_params->SetString("filters", filter->OrderedFilterList()); 32 event_params->SetString("filters", filter->OrderedFilterList());
33 return event_params; 33 return event_params.release();
34 } 34 }
35 35
36 std::string ComputeMethodForRedirect(const std::string& method, 36 std::string ComputeMethodForRedirect(const std::string& method,
37 int http_status_code) { 37 int http_status_code) {
38 // For 303 redirects, all request methods except HEAD are converted to GET, 38 // For 303 redirects, all request methods except HEAD are converted to GET,
39 // as per the latest httpbis draft. The draft also allows POST requests to 39 // as per the latest httpbis draft. The draft also allows POST requests to
40 // be converted to GETs when following 301/302 redirects, for historical 40 // be converted to GETs when following 301/302 redirects, for historical
41 // reasons. Most major browsers do this and so shall we. Both RFC 2616 and 41 // reasons. Most major browsers do this and so shall we. Both RFC 2616 and
42 // the httpbis draft say to prompt the user to confirm the generation of new 42 // the httpbis draft say to prompt the user to confirm the generation of new
43 // requests, other than GET and HEAD requests, but IE omits these prompts and 43 // requests, other than GET and HEAD requests, but IE omits these prompts and
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). 861 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS).
862 redirect_info.new_referrer = 862 redirect_info.new_referrer =
863 ComputeReferrerForRedirect(request_->referrer_policy(), 863 ComputeReferrerForRedirect(request_->referrer_policy(),
864 request_->referrer(), 864 request_->referrer(),
865 redirect_info.new_url).spec(); 865 redirect_info.new_url).spec();
866 866
867 return redirect_info; 867 return redirect_info;
868 } 868 }
869 869
870 } // namespace net 870 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698