summaryrefslogtreecommitdiffstats
path: root/content/browser/fileapi
diff options
context:
space:
mode:
authorhidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-09 14:18:19 +0000
committerhidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-09 14:18:19 +0000
commitdc2499213b1f2cbf78e889a81f69b5b219c625e7 (patch)
tree7f5065ccb5f51dcb0422a1cd956353fbfdad27ed /content/browser/fileapi
parentf4d659e5b889d88c3829a80f3677cf23bdcae6be (diff)
downloadchromium_src-dc2499213b1f2cbf78e889a81f69b5b219c625e7.zip
chromium_src-dc2499213b1f2cbf78e889a81f69b5b219c625e7.tar.gz
chromium_src-dc2499213b1f2cbf78e889a81f69b5b219c625e7.tar.bz2
Allow passing null-callback to |on_close_callback| explicitly.
On most file system, |on_close_callback| would do nothing. To make it easy, this CL allows to pass null-callback to |on_close_callback| via OpenFileCallback. Note that, it is already checked if the callback is null or not in FileAPIMessageFilter::OnNotifyCloseFile(), but it wasn't in OnChannelClosing(). This CL adds the Callback::is_null() check in the method, as well as adds comments about the null for FileSystemOperation::OpenFileCallback. BUG=258303 TEST=Ran try-bot Review URL: https://chromiumcodereview.appspot.com/18132021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/fileapi')
-rw-r--r--content/browser/fileapi/fileapi_message_filter.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
index d6bc272..5d1db3b 100644
--- a/content/browser/fileapi/fileapi_message_filter.cc
+++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -121,7 +121,10 @@ void FileAPIMessageFilter::OnChannelClosing() {
for (OnCloseCallbackMap::iterator itr(&on_close_callbacks_);
!itr.IsAtEnd(); itr.Advance()) {
- itr.GetCurrentValue()->Run();
+ const base::Closure* callback = itr.GetCurrentValue();
+ DCHECK(callback);
+ if (!callback->is_null())
+ callback->Run();
}
on_close_callbacks_.Clear();