OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "chrome/browser/download/download_completion_blocker.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 DownloadCompletionBlocker::DownloadCompletionBlocker() |
| 10 : is_complete_(false) { |
| 11 } |
| 12 |
| 13 DownloadCompletionBlocker::~DownloadCompletionBlocker() { |
| 14 } |
| 15 |
| 16 void DownloadCompletionBlocker::CompleteDownload() { |
| 17 DCHECK(!is_complete_); |
| 18 is_complete_ = true; |
| 19 if (callback_.is_null()) |
| 20 return; |
| 21 callback_.Run(); |
| 22 callback_.Reset(); |
| 23 } |
OLD | NEW |