summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-20 20:29:29 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-20 20:29:29 +0000
commitd99671151e98412870f1adf719b4a94fc9a7ca52 (patch)
treefa2854bb5443c78e385edc6c0e0f5e04fabd89ba /chrome/common
parentd049874acef2be3c17612d4a06b480f3a45ea6e9 (diff)
downloadchromium_src-d99671151e98412870f1adf719b4a94fc9a7ca52.zip
chromium_src-d99671151e98412870f1adf719b4a94fc9a7ca52.tar.gz
chromium_src-d99671151e98412870f1adf719b4a94fc9a7ca52.tar.bz2
Reland r59511: Eagerly set the IO loop used for OCSP.
ChromeOS will create a special Profile for login. Previously, OCSP initialization was done for the "default" ChromeURLRequestContext for each Profile. Since we can have multiple profiles, this causes the initialization (and uninitialization) to happen multiple times, which causes problems for OCSP since we use statics. The solution is to identify the "main" Profile. We create said Profile in BrowserMain. I add an "is_main_" variable to URLRequestContextGetter and URLRequestContext, so that only the "main" URLRequestContext will initialize OCSP. Other than minor plumbing of "is_main_", this changelist is identical to r59511. BUG=55940 TEST=Startup ChromeOS's Chrome. Should not crash on startup. Review URL: http://codereview.chromium.org/3470001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/net/url_request_context_getter.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome/common/net/url_request_context_getter.h b/chrome/common/net/url_request_context_getter.h
index 34aa668..c3e6d09 100644
--- a/chrome/common/net/url_request_context_getter.h
+++ b/chrome/common/net/url_request_context_getter.h
@@ -35,15 +35,32 @@ class URLRequestContextGetter
// may be used).
virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() = 0;
+ // Controls whether or not the URLRequestContextGetter considers itself to be
+ // the the "main" URLRequestContextGetter. Note that each Profile will have a
+ // "default" URLRequestContextGetter. Therefore, "is_main" refers to the
+ // default URLRequestContextGetter for the "main" Profile.
+ // TODO(willchan): Move this code to ChromeURLRequestContextGetter, since this
+ // ia a browser process specific concept.
+ void set_is_main(bool is_main) { is_main_ = true; }
+
protected:
friend class DeleteTask<URLRequestContextGetter>;
friend struct URLRequestContextGetterTraits;
+ URLRequestContextGetter() : is_main_(false) {}
+
virtual ~URLRequestContextGetter() {}
+
+ bool is_main() const { return is_main_; }
+
private:
// OnDestruct is meant to ensure deletion on the thread on which the request
// IO happens.
void OnDestruct();
+
+ // Indicates whether or not this is the default URLRequestContextGetter for
+ // the main Profile.
+ bool is_main_;
};
struct URLRequestContextGetterTraits {
@@ -53,4 +70,3 @@ struct URLRequestContextGetterTraits {
};
#endif // CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_
-