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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 10407124: Don't force non-session only cookies to be session only cookies, instead delete on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | 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/net/chrome_network_delegate.h" 5 #include "chrome/browser/net/chrome_network_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/content_settings/cookie_settings.h" 9 #include "chrome/browser/content_settings/cookie_settings.h"
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, 296 bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
297 const std::string& cookie_line, 297 const std::string& cookie_line,
298 net::CookieOptions* options) { 298 net::CookieOptions* options) {
299 // NULL during tests, or when we're running in the system context. 299 // NULL during tests, or when we're running in the system context.
300 if (!cookie_settings_) 300 if (!cookie_settings_)
301 return true; 301 return true;
302 302
303 bool allow = cookie_settings_->IsSettingCookieAllowed( 303 bool allow = cookie_settings_->IsSettingCookieAllowed(
304 request.url(), request.first_party_for_cookies()); 304 request.url(), request.first_party_for_cookies());
305 305
306 if (cookie_settings_->IsCookieSessionOnly(request.url()))
307 options->set_force_session();
308
309 int render_process_id = -1; 306 int render_process_id = -1;
310 int render_view_id = -1; 307 int render_view_id = -1;
311 if (content::ResourceRequestInfo::GetRenderViewForRequest( 308 if (content::ResourceRequestInfo::GetRenderViewForRequest(
312 &request, &render_process_id, &render_view_id)) { 309 &request, &render_process_id, &render_view_id)) {
313 BrowserThread::PostTask( 310 BrowserThread::PostTask(
314 BrowserThread::UI, FROM_HERE, 311 BrowserThread::UI, FROM_HERE,
315 base::Bind(&TabSpecificContentSettings::CookieChanged, 312 base::Bind(&TabSpecificContentSettings::CookieChanged,
316 render_process_id, render_view_id, 313 render_process_id, render_view_id,
317 request.url(), request.first_party_for_cookies(), 314 request.url(), request.first_party_for_cookies(),
318 cookie_line, *options, !allow)); 315 cookie_line, *options, !allow));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 if (white_listed_path == path.StripTrailingSeparators() || 347 if (white_listed_path == path.StripTrailingSeparators() ||
351 white_listed_path.IsParent(path)) { 348 white_listed_path.IsParent(path)) {
352 return true; 349 return true;
353 } 350 }
354 } 351 }
355 return false; 352 return false;
356 #else 353 #else
357 return true; 354 return true;
358 #endif // defined(OS_CHROMEOS) 355 #endif // defined(OS_CHROMEOS)
359 } 356 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698