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

Side by Side Diff: content/test/net/url_request_abort_on_end_job.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | 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 // This class simulates what wininet does when a dns lookup fails. 4 // This class simulates what wininet does when a dns lookup fails.
5 5
6 #include <algorithm> 6 #include <algorithm>
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 URLRequestAbortOnEndJob::~URLRequestAbortOnEndJob() { 76 URLRequestAbortOnEndJob::~URLRequestAbortOnEndJob() {
77 } 77 }
78 78
79 void URLRequestAbortOnEndJob::GetResponseInfo(net::HttpResponseInfo* info) { 79 void URLRequestAbortOnEndJob::GetResponseInfo(net::HttpResponseInfo* info) {
80 GetResponseInfoConst(info); 80 GetResponseInfoConst(info);
81 } 81 }
82 82
83 bool URLRequestAbortOnEndJob::GetMimeType(std::string* mime_type) const { 83 bool URLRequestAbortOnEndJob::GetMimeType(std::string* mime_type) const {
84 net::HttpResponseInfo info; 84 net::HttpResponseInfo info;
85 GetResponseInfoConst(&info); 85 GetResponseInfoConst(&info);
86 return info.headers && info.headers->GetMimeType(mime_type); 86 return info.headers.get() && info.headers->GetMimeType(mime_type);
87 } 87 }
88 88
89 void URLRequestAbortOnEndJob::StartAsync() { 89 void URLRequestAbortOnEndJob::StartAsync() {
90 NotifyHeadersComplete(); 90 NotifyHeadersComplete();
91 } 91 }
92 92
93 void URLRequestAbortOnEndJob::Start() { 93 void URLRequestAbortOnEndJob::Start() {
94 base::MessageLoop::current()->PostTask( 94 base::MessageLoop::current()->PostTask(
95 FROM_HERE, 95 FROM_HERE,
96 base::Bind(&URLRequestAbortOnEndJob::StartAsync, 96 base::Bind(&URLRequestAbortOnEndJob::StartAsync,
(...skipping 10 matching lines...) Expand all
107 return true; 107 return true;
108 } 108 }
109 109
110 SetStatus(net::URLRequestStatus(net::URLRequestStatus::FAILED, 110 SetStatus(net::URLRequestStatus(net::URLRequestStatus::FAILED,
111 net::ERR_CONNECTION_ABORTED)); 111 net::ERR_CONNECTION_ABORTED));
112 *bytes_read = -1; 112 *bytes_read = -1;
113 return false; 113 return false;
114 } 114 }
115 115
116 } // namespace content 116 } // namespace content
OLDNEW
« no previous file with comments | « content/test/content_browser_test_utils.cc ('k') | content/test/net/url_request_mock_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698