// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/extension_function.h"

#include "chrome/browser/extensions/extension_function_dispatcher.h"

void ExtensionFunction::SendResponse(bool success) {
  if (success) {
    if (has_callback()) {
      dispatcher_->SendResponse(this);
    }
  } else {
    // TODO(aa): In case of failure, send the error message to an error
    // callback.
  }
}

// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/extension_function.h"

#include "chrome/browser/extensions/extension_function_dispatcher.h"

void ExtensionFunction::SendResponse(bool success) {
  if (success) {
    dispatcher_->SendResponse(this);
  } else {
    // TODO(aa): In case of failure, send the error message to an error
    // callback.
  }
}

--- 
+++ 
@@ -8,7 +8,9 @@
 
 void ExtensionFunction::SendResponse(bool success) {
   if (success) {
-    dispatcher_->SendResponse(this);
+    if (has_callback()) {
+      dispatcher_->SendResponse(this);
+    }
   } else {
     // TODO(aa): In case of failure, send the error message to an error
     // callback.
Check that the ExtensionFunction has a callback for attempting to send a response.

Review URL: http://codereview.chromium.org/63130

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@13406 0039d316-1c4b-4281-b951-d872f2087c98
