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

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

Issue 8018: Clean up filter and content encoding handling ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_job.h ('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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
(...skipping 29 matching lines...) Expand all
40 // request took care of setting its error status before calling Kill. 40 // request took care of setting its error status before calling Kill.
41 if (request_) 41 if (request_)
42 NotifyCanceled(); 42 NotifyCanceled();
43 } 43 }
44 44
45 void URLRequestJob::DetachRequest() { 45 void URLRequestJob::DetachRequest() {
46 request_ = NULL; 46 request_ = NULL;
47 } 47 }
48 48
49 void URLRequestJob::SetupFilter() { 49 void URLRequestJob::SetupFilter() {
50 std::vector<std::string> encoding_types; 50 std::vector<Filter::FilterType> encoding_types;
51 if (GetContentEncodings(&encoding_types)) { 51 if (GetContentEncodings(&encoding_types)) {
52 std::string mime_type; 52 filter_.reset(Filter::Factory(encoding_types, kFilterBufSize));
53 GetMimeType(&mime_type);
54 filter_.reset(Filter::Factory(encoding_types, mime_type, kFilterBufSize));
55 if (filter_.get()) { 53 if (filter_.get()) {
54 std::string mime_type;
55 GetMimeType(&mime_type);
56 filter_->SetURL(request_->url()); 56 filter_->SetURL(request_->url());
57 filter_->SetMimeType(mime_type); 57 filter_->SetMimeType(mime_type);
58 } 58 }
59 } 59 }
60 } 60 }
61 61
62 void URLRequestJob::GetAuthChallengeInfo( 62 void URLRequestJob::GetAuthChallengeInfo(
63 scoped_refptr<net::AuthChallengeInfo>* auth_info) { 63 scoped_refptr<net::AuthChallengeInfo>* auth_info) {
64 // This will only be called if NeedsAuth() returns true, in which 64 // This will only be called if NeedsAuth() returns true, in which
65 // case the derived class should implement this! 65 // case the derived class should implement this!
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 // If the request is gone, we must be cancelled. 492 // If the request is gone, we must be cancelled.
493 return URLRequestStatus(URLRequestStatus::CANCELED, 493 return URLRequestStatus(URLRequestStatus::CANCELED,
494 net::ERR_ABORTED); 494 net::ERR_ABORTED);
495 } 495 }
496 496
497 void URLRequestJob::SetStatus(const URLRequestStatus &status) { 497 void URLRequestJob::SetStatus(const URLRequestStatus &status) {
498 if (request_) 498 if (request_)
499 request_->set_status(status); 499 request_->set_status(status);
500 } 500 }
501 501
OLDNEW
« no previous file with comments | « net/url_request/url_request_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698