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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.h

Issue 9310020: Add SafeBrowsingURLRequestContext which stores cookies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes, fix DownloadProtectionServiceTest Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_service.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index aacf4aff54ec37aa3912c3ce48b117a3f7a8a2f4..9cc5f463e7c45718c100eb279a2a9b19ab6bb355 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -35,12 +35,14 @@ class PrefService;
class SafeBrowsingDatabase;
class SafeBrowsingProtocolManager;
class SafeBrowsingServiceFactory;
+class SafeBrowsingURLRequestContextGetter;
namespace base {
class Thread;
}
namespace net {
+class URLRequestContext;
class URLRequestContextGetter;
}
@@ -341,14 +343,21 @@ class SafeBrowsingService
content::BrowserThread::UI>;
friend class base::DeleteHelper<SafeBrowsingService>;
friend class SafeBrowsingServiceTest;
+ friend class SafeBrowsingURLRequestContextGetter;
- // Called to initialize objects that are used on the io_thread.
- void OnIOInitialize(const std::string& client_key,
- const std::string& wrapped_key,
- net::URLRequestContextGetter* request_context_getter);
+ void InitURLRequestContextOnIOThread(
+ net::URLRequestContextGetter* system_url_request_context_getter);
- // Called to shutdown operations on the io_thread.
- void OnIOShutdown();
+ void DestroyURLRequestContextOnIOThread();
+
+ // Called to initialize objects that are used on the io_thread. This may be
+ // called multiple times during the life of the SafeBrowsingService.
+ void StartOnIOThread(const std::string& client_key,
+ const std::string& wrapped_key);
+
+ // Called to shutdown operations on the io_thread. This may be called multiple
+ // times during the life of the SafeBrowsingService.
+ void StopOnIOThread();
// Returns whether |database_| exists and is accessible.
bool DatabaseAvailable() const;
@@ -503,6 +512,14 @@ class SafeBrowsingService
// Lock used to prevent possible data races due to compiler optimizations.
mutable base::Lock database_lock_;
+ // The SafeBrowsingURLRequestContextGetter used to access
+ // |url_request_context_|.
+ scoped_refptr<net::URLRequestContextGetter>
+ url_request_context_getter_;
+
+ // The SafeBrowsingURLRequestContext.
+ scoped_refptr<net::URLRequestContext> url_request_context_;
+
// Handles interaction with SafeBrowsing servers.
SafeBrowsingProtocolManager* protocol_manager_;

Powered by Google App Engine
This is Rietveld 408576698