OLD | NEW |
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/safe_browsing/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 #if defined(FULL_SAFE_BROWSING) | 293 #if defined(FULL_SAFE_BROWSING) |
294 return new SafeBrowsingDatabaseManager(this); | 294 return new SafeBrowsingDatabaseManager(this); |
295 #else | 295 #else |
296 return NULL; | 296 return NULL; |
297 #endif | 297 #endif |
298 } | 298 } |
299 | 299 |
300 void SafeBrowsingService::InitURLRequestContextOnIOThread( | 300 void SafeBrowsingService::InitURLRequestContextOnIOThread( |
301 net::URLRequestContextGetter* system_url_request_context_getter) { | 301 net::URLRequestContextGetter* system_url_request_context_getter) { |
| 302 using content::CookieStoreConfig; |
| 303 |
302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 304 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
303 DCHECK(!url_request_context_.get()); | 305 DCHECK(!url_request_context_.get()); |
304 | 306 |
305 scoped_refptr<net::CookieStore> cookie_store( | 307 scoped_refptr<net::CookieStore> cookie_store( |
306 content::CreatePersistentCookieStore( | 308 CreateCookieStore( |
307 CookieFilePath(), | 309 CookieStoreConfig(CookieFilePath(), |
308 false, | 310 CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, |
309 NULL, | 311 NULL, NULL))); |
310 NULL)); | |
311 | 312 |
312 url_request_context_.reset(new net::URLRequestContext); | 313 url_request_context_.reset(new net::URLRequestContext); |
313 // |system_url_request_context_getter| may be NULL during tests. | 314 // |system_url_request_context_getter| may be NULL during tests. |
314 if (system_url_request_context_getter) { | 315 if (system_url_request_context_getter) { |
315 url_request_context_->CopyFrom( | 316 url_request_context_->CopyFrom( |
316 system_url_request_context_getter->GetURLRequestContext()); | 317 system_url_request_context_getter->GetURLRequestContext()); |
317 } | 318 } |
318 url_request_context_->set_cookie_store(cookie_store.get()); | 319 url_request_context_->set_cookie_store(cookie_store.get()); |
319 } | 320 } |
320 | 321 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 #if defined(FULL_SAFE_BROWSING) | 481 #if defined(FULL_SAFE_BROWSING) |
481 if (csd_service_.get()) | 482 if (csd_service_.get()) |
482 csd_service_->SetEnabledAndRefreshState(enable); | 483 csd_service_->SetEnabledAndRefreshState(enable); |
483 if (download_service_.get()) { | 484 if (download_service_.get()) { |
484 download_service_->SetEnabled( | 485 download_service_->SetEnabled( |
485 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 486 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
486 switches::kDisableImprovedDownloadProtection)); | 487 switches::kDisableImprovedDownloadProtection)); |
487 } | 488 } |
488 #endif | 489 #endif |
489 } | 490 } |
OLD | NEW |