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

Side by Side Diff: chrome/browser/search_engines/template_url_fetcher.cc

Issue 9565003: Merge 124282 - Disable storing cookies from URLFetchers that run with a profile's cookie jar. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/963/src/
Patch Set: 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/search_engines/template_url_fetcher.h" 7 #include "chrome/browser/search_engines/template_url_fetcher.h"
8 8
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/search_engines/template_url.h" 12 #include "chrome/browser/search_engines/template_url.h"
13 #include "chrome/browser/search_engines/template_url_fetcher_callbacks.h" 13 #include "chrome/browser/search_engines/template_url_fetcher_callbacks.h"
14 #include "chrome/browser/search_engines/template_url_service.h" 14 #include "chrome/browser/search_engines/template_url_service.h"
15 #include "chrome/browser/search_engines/template_url_service_factory.h" 15 #include "chrome/browser/search_engines/template_url_service_factory.h"
16 #include "chrome/browser/search_engines/template_url_parser.h" 16 #include "chrome/browser/search_engines/template_url_parser.h"
17 #include "chrome/common/chrome_notification_types.h" 17 #include "chrome/common/chrome_notification_types.h"
18 #include "content/public/browser/notification_observer.h" 18 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 19 #include "content/public/browser/notification_registrar.h"
20 #include "content/public/browser/notification_source.h" 20 #include "content/public/browser/notification_source.h"
21 #include "content/public/common/url_fetcher.h" 21 #include "content/public/common/url_fetcher.h"
22 #include "content/public/common/url_fetcher_delegate.h" 22 #include "content/public/common/url_fetcher_delegate.h"
23 #include "net/base/load_flags.h"
23 #include "net/url_request/url_request_status.h" 24 #include "net/url_request/url_request_status.h"
24 25
25 // RequestDelegate ------------------------------------------------------------ 26 // RequestDelegate ------------------------------------------------------------
26 class TemplateURLFetcher::RequestDelegate 27 class TemplateURLFetcher::RequestDelegate
27 : public content::URLFetcherDelegate, 28 : public content::URLFetcherDelegate,
28 public content::NotificationObserver { 29 public content::NotificationObserver {
29 public: 30 public:
30 // Takes ownership of |callbacks|. 31 // Takes ownership of |callbacks|.
31 RequestDelegate(TemplateURLFetcher* fetcher, 32 RequestDelegate(TemplateURLFetcher* fetcher,
32 const string16& keyword, 33 const string16& keyword,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 94
94 if (!model->loaded()) { 95 if (!model->loaded()) {
95 // Start the model load and set-up waiting for it. 96 // Start the model load and set-up waiting for it.
96 registrar_.Add(this, 97 registrar_.Add(this,
97 chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, 98 chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED,
98 content::Source<TemplateURLService>(model)); 99 content::Source<TemplateURLService>(model));
99 model->Load(); 100 model->Load();
100 } 101 }
101 102
102 url_fetcher_->SetRequestContext(fetcher->profile()->GetRequestContext()); 103 url_fetcher_->SetRequestContext(fetcher->profile()->GetRequestContext());
104 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
103 url_fetcher_->Start(); 105 url_fetcher_->Start();
104 } 106 }
105 107
106 void TemplateURLFetcher::RequestDelegate::Observe( 108 void TemplateURLFetcher::RequestDelegate::Observe(
107 int type, 109 int type,
108 const content::NotificationSource& source, 110 const content::NotificationSource& source,
109 const content::NotificationDetails& details) { 111 const content::NotificationDetails& details) {
110 DCHECK(type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED); 112 DCHECK(type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED);
111 113
112 if (!template_url_.get()) 114 if (!template_url_.get())
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 new RequestDelegate(this, keyword, osdd_url, favicon_url, 321 new RequestDelegate(this, keyword, osdd_url, favicon_url,
320 owned_callbacks.release(), provider_type)); 322 owned_callbacks.release(), provider_type));
321 } 323 }
322 324
323 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { 325 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) {
324 DCHECK(find(requests_->begin(), requests_->end(), request) != 326 DCHECK(find(requests_->begin(), requests_->end(), request) !=
325 requests_->end()); 327 requests_->end());
326 requests_->erase(find(requests_->begin(), requests_->end(), request)); 328 requests_->erase(find(requests_->begin(), requests_->end(), request));
327 delete request; 329 delete request;
328 } 330 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_downloader.cc ('k') | chrome/browser/spellchecker/spellcheck_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698