summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_completion_blocker.cc
blob: 5ed0ea996e35b5919bbcbe7f64895127f262c6e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2012 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/download/download_completion_blocker.h"

#include "base/logging.h"

DownloadCompletionBlocker::DownloadCompletionBlocker()
  : is_complete_(false) {
}

DownloadCompletionBlocker::~DownloadCompletionBlocker() {
}

void DownloadCompletionBlocker::CompleteDownload() {
  DCHECK(!is_complete_);
  is_complete_ = true;
  if (callback_.is_null())
    return;
  callback_.Run();
  callback_.Reset();
}