From 6480a1b95f6aa60071f7d9f12f41150689264e3f Mon Sep 17 00:00:00 2001 From: "michaeln@google.com" Date: Wed, 18 Nov 2009 00:55:27 +0000 Subject: Fix a crashing bug around ApplicationCacheDispatcherHost::Initialize in the mac port. TEST=existing tests BUG=26754 Review URL: http://codereview.chromium.org/402025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32243 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/appcache/appcache_dispatcher_host.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'chrome/common/appcache') diff --git a/chrome/common/appcache/appcache_dispatcher_host.cc b/chrome/common/appcache/appcache_dispatcher_host.cc index d609858..854d5d8 100644 --- a/chrome/common/appcache/appcache_dispatcher_host.cc +++ b/chrome/common/appcache/appcache_dispatcher_host.cc @@ -14,6 +14,7 @@ AppCacheDispatcherHost::AppCacheDispatcherHost( URLRequestContextGetter* request_context_getter) : request_context_getter_(request_context_getter), process_handle_(0) { + DCHECK(request_context_getter_.get()); } void AppCacheDispatcherHost::Initialize(IPC::Message::Sender* sender, @@ -23,10 +24,13 @@ void AppCacheDispatcherHost::Initialize(IPC::Message::Sender* sender, process_handle_ = process_handle; // Get the AppCacheService (it can only be accessed from IO thread). - URLRequestContext* context = request_context_getter_->GetURLRequestContext(); - appcache_service_ = - static_cast(context)->appcache_service(); - request_context_getter_ = NULL; + if (request_context_getter_.get()) { + URLRequestContext* context = + request_context_getter_->GetURLRequestContext(); + appcache_service_ = + static_cast(context)->appcache_service(); + request_context_getter_ = NULL; + } frontend_proxy_.set_sender(sender); if (appcache_service_.get()) { -- cgit v1.1