1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/download/download_completion_blocker.h"
7 #include "base/logging.h"
9 DownloadCompletionBlocker::DownloadCompletionBlocker()
10 : is_complete_(false) {
13 DownloadCompletionBlocker::~DownloadCompletionBlocker() {
16 void DownloadCompletionBlocker::CompleteDownload() {
17 // Do not run |callback_| more than once.
22 if (callback_
.is_null())
25 // |callback_| may delete |this|, so do not rely on |this| after running