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

Side by Side Diff: chrome/browser/autofill/autofill_download.cc

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 8 years, 9 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 4
5 #include "chrome/browser/autofill/autofill_download.h" 5 #include "chrome/browser/autofill/autofill_download.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/rand_util.h" 12 #include "base/rand_util.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "chrome/browser/autofill/autofill_metrics.h" 15 #include "chrome/browser/autofill/autofill_metrics.h"
16 #include "chrome/browser/autofill/autofill_xml_parser.h" 16 #include "chrome/browser/autofill/autofill_xml_parser.h"
17 #include "chrome/browser/autofill/form_structure.h" 17 #include "chrome/browser/autofill/form_structure.h"
18 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/common/pref_names.h" 20 #include "chrome/common/pref_names.h"
21 #include "content/public/common/content_url_request_user_data.h"
21 #include "content/public/common/url_fetcher.h" 22 #include "content/public/common/url_fetcher.h"
22 #include "googleurl/src/gurl.h" 23 #include "googleurl/src/gurl.h"
23 #include "net/base/load_flags.h" 24 #include "net/base/load_flags.h"
24 #include "net/http/http_response_headers.h" 25 #include "net/http/http_response_headers.h"
25 #include "third_party/libjingle/source/talk/xmllite/xmlparser.h" 26 #include "third_party/libjingle/source/talk/xmllite/xmlparser.h"
26 27
27 namespace { 28 namespace {
28 const char kAutofillQueryServerRequestUrl[] = 29 const char kAutofillQueryServerRequestUrl[] =
29 "https://clients1.google.com/tbproxy/af/query?client="; 30 "https://clients1.google.com/tbproxy/af/query?client=";
30 const char kAutofillUploadServerRequestUrl[] = 31 const char kAutofillUploadServerRequestUrl[] =
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 request_url += kClientName; 171 request_url += kClientName;
171 172
172 // Id is ignored for regular chrome, in unit test id's for fake fetcher 173 // Id is ignored for regular chrome, in unit test id's for fake fetcher
173 // factory will be 0, 1, 2, ... 174 // factory will be 0, 1, 2, ...
174 content::URLFetcher* fetcher = content::URLFetcher::Create( 175 content::URLFetcher* fetcher = content::URLFetcher::Create(
175 fetcher_id_for_unittest_++, GURL(request_url), content::URLFetcher::POST, 176 fetcher_id_for_unittest_++, GURL(request_url), content::URLFetcher::POST,
176 this); 177 this);
177 url_fetchers_[fetcher] = request_data; 178 url_fetchers_[fetcher] = request_data;
178 fetcher->SetAutomaticallyRetryOn5xx(false); 179 fetcher->SetAutomaticallyRetryOn5xx(false);
179 fetcher->SetRequestContext(request_context); 180 fetcher->SetRequestContext(request_context);
181 // TODO(jochen): Do cookie audit.
182 fetcher->SetContentURLRequestUserData(
183 new content::ContentURLRequestUserData());
180 fetcher->SetUploadData("text/plain", form_xml); 184 fetcher->SetUploadData("text/plain", form_xml);
181 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); 185 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
182 fetcher->Start(); 186 fetcher->Start();
183 return true; 187 return true;
184 } 188 }
185 189
186 void AutofillDownloadManager::CacheQueryRequest( 190 void AutofillDownloadManager::CacheQueryRequest(
187 const std::vector<std::string>& forms_in_query, 191 const std::vector<std::string>& forms_in_query,
188 const std::string& query_data) { 192 const std::string& query_data) {
189 std::string signature = GetCombinedSignature(forms_in_query); 193 std::string signature = GetCombinedSignature(forms_in_query);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 SetPositiveUploadRate(new_positive_upload_rate); 312 SetPositiveUploadRate(new_positive_upload_rate);
309 SetNegativeUploadRate(new_negative_upload_rate); 313 SetNegativeUploadRate(new_negative_upload_rate);
310 } 314 }
311 315
312 observer_->OnUploadedPossibleFieldTypes(); 316 observer_->OnUploadedPossibleFieldTypes();
313 } 317 }
314 } 318 }
315 delete it->first; 319 delete it->first;
316 url_fetchers_.erase(it); 320 url_fetchers_.erase(it);
317 } 321 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698