diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-26 17:22:54 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-26 17:22:54 +0000 |
commit | e99ca5111f19b5401f0e18e52a0ebbddc8a36f78 (patch) | |
tree | 783c4faacbaf48e2bdfd40aa4bbb6ee38079bbb9 /content/shell/shell_browser_context.cc | |
parent | 30fcaa494a7c2fd728821d603816d19f764857f6 (diff) | |
download | chromium_src-e99ca5111f19b5401f0e18e52a0ebbddc8a36f78.zip chromium_src-e99ca5111f19b5401f0e18e52a0ebbddc8a36f78.tar.gz chromium_src-e99ca5111f19b5401f0e18e52a0ebbddc8a36f78.tar.bz2 |
A few improvements to content_shell:
-support multiple windows, this allows window.open to work
-add menu to create new windows-update buttons and url bar
-ensure we destruct ResourceContext on the right thread
-ensure we destruct BrowserContext while all the threads are still alive
-add http:// to the url if the user forgot to enter it
BUG= 90445
Review URL: http://codereview.chromium.org/8043011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell_browser_context.cc')
-rw-r--r-- | content/shell/shell_browser_context.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc index fed9fba..b49f758 100644 --- a/content/shell/shell_browser_context.cc +++ b/content/shell/shell_browser_context.cc @@ -80,15 +80,15 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter { dnsrr_resolver_.reset(new net::DnsRRResolver()); - proxy_config_service_.reset( + net::ProxyConfigService* proxy_config_service = net::ProxyService::CreateSystemProxyConfigService( io_loop_, - file_loop_)); + file_loop_); // TODO(jam): use v8 if possible, look at chrome code. proxy_service_.reset( net::ProxyService::CreateUsingSystemProxyResolver( - proxy_config_service_.get(), + proxy_config_service, 0, net_log)); @@ -163,7 +163,6 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter { scoped_ptr<net::CertVerifier> cert_verifier_; scoped_ptr<net::OriginBoundCertService> origin_bound_cert_service_; scoped_ptr<net::DnsRRResolver> dnsrr_resolver_; - scoped_ptr<net::ProxyConfigService> proxy_config_service_; scoped_ptr<net::ProxyService> proxy_service_; scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory_; scoped_ptr<net::URLSecurityManager> url_security_manager_; @@ -228,22 +227,27 @@ ShellBrowserContext::ShellBrowserContext( } ShellBrowserContext::~ShellBrowserContext() { + if (resource_context_.get()) { + BrowserThread::DeleteSoon( + BrowserThread::IO, FROM_HERE, resource_context_.release()); + } } FilePath ShellBrowserContext::GetPath() { - FilePath result; + if (!path_.empty()) + return path_; #if defined(OS_WIN) - CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &result)); - result.Append(std::wstring(L"content_shell")); + CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path_)); + path_ = path_.Append(std::wstring(L"content_shell")); #else NOTIMPLEMENTED(); #endif - if (!file_util::PathExists(result)) - file_util::CreateDirectory(result); + if (!file_util::PathExists(path_)) + file_util::CreateDirectory(path_); - return result; + return path_; } bool ShellBrowserContext::IsOffTheRecord() { @@ -359,6 +363,8 @@ fileapi::FileSystemContext* ShellBrowserContext::GetFileSystemContext() { } void ShellBrowserContext::CreateQuotaManagerAndClients() { + if (quota_manager_.get()) + return; quota_manager_ = new quota::QuotaManager( IsOffTheRecord(), GetPath(), |