diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 19:07:01 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 19:07:01 +0000 |
commit | 32dda3615ecec2a9f0ce3318658588b4103d997d (patch) | |
tree | 0705a3eeb8f48c52329a1dcc5804aee59d80966a /chrome/browser/extensions/extension_function.cc | |
parent | c2f5dd7f69af7a59321e5acd1aa39fea5b2b2bfd (diff) | |
download | chromium_src-32dda3615ecec2a9f0ce3318658588b4103d997d.zip chromium_src-32dda3615ecec2a9f0ce3318658588b4103d997d.tar.gz chromium_src-32dda3615ecec2a9f0ce3318658588b4103d997d.tar.bz2 |
Make AsyncExtensionFunction possible.
Change the bookmarks API to be async functions, so that they can delay their
response until the bookmark system is loaded.
BUG=12353
TEST=none
Review URL: http://codereview.chromium.org/114079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_function.cc')
-rw-r--r-- | chrome/browser/extensions/extension_function.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_function.cc b/chrome/browser/extensions/extension_function.cc index a846d96..26adefb 100644 --- a/chrome/browser/extensions/extension_function.cc +++ b/chrome/browser/extensions/extension_function.cc @@ -33,17 +33,21 @@ const std::string AsyncExtensionFunction::GetResult() { } void AsyncExtensionFunction::SendResponse(bool success) { + if (!dispatcher()) + return; if (bad_message_) { - dispatcher_->HandleBadMessage(this); + dispatcher()->HandleBadMessage(this); } else { - dispatcher_->SendResponse(this, success); + dispatcher()->SendResponse(this, success); } } std::string AsyncExtensionFunction::extension_id() { - return dispatcher_->extension_id(); + DCHECK(dispatcher()); + return dispatcher()->extension_id(); } Profile* AsyncExtensionFunction::profile() { - return dispatcher_->profile(); + DCHECK(dispatcher()); + return dispatcher()->profile(); } |