OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "stdafx.h" | 5 #include "stdafx.h" |
6 #include "win8/metro_driver/print_document_source.h" | 6 #include "win8/metro_driver/print_document_source.h" |
7 | 7 |
8 #include <windows.graphics.display.h> | 8 #include <windows.graphics.display.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 DCHECK(page_count > 0); | 386 DCHECK(page_count > 0); |
387 { | 387 { |
388 base::AutoLock lock(*parent_lock_); | 388 base::AutoLock lock(*parent_lock_); |
389 DCHECK(!page_count_ready_.IsSignaled()); | 389 DCHECK(!page_count_ready_.IsSignaled()); |
390 DCHECK(pages_.empty() && pages_ready_state_.empty()); | 390 DCHECK(pages_.empty() && pages_ready_state_.empty()); |
391 | 391 |
392 pages_.resize(page_count); | 392 pages_.resize(page_count); |
393 pages_ready_state_.resize(page_count); | 393 pages_ready_state_.resize(page_count); |
394 | 394 |
395 for (size_t i = 0; i < page_count; ++i) | 395 for (size_t i = 0; i < page_count; ++i) |
396 pages_ready_state_[i].reset(new base::ConditionVariable(parent_lock_)); | 396 pages_ready_state_[i] = new base::ConditionVariable(parent_lock_); |
397 } | 397 } |
398 page_count_ready_.Signal(); | 398 page_count_ready_.Signal(); |
399 } | 399 } |
400 | 400 |
401 void PrintDocumentSource::AddPage(size_t page_number, | 401 void PrintDocumentSource::AddPage(size_t page_number, |
402 IStream* metafile_stream) { | 402 IStream* metafile_stream) { |
403 DCHECK(metafile_stream != NULL); | 403 DCHECK(metafile_stream != NULL); |
404 base::AutoLock lock(*parent_lock_); | 404 base::AutoLock lock(*parent_lock_); |
405 | 405 |
406 DCHECK(page_count_ready_.IsSignaled()); | 406 DCHECK(page_count_ready_.IsSignaled()); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 | 518 |
519 hr = factory1->CreateGdiMetafile(pages_[page_number].Get(), gdi_metafile); | 519 hr = factory1->CreateGdiMetafile(pages_[page_number].Get(), gdi_metafile); |
520 if (FAILED(hr)) { | 520 if (FAILED(hr)) { |
521 LOG(ERROR) << "Failed to CreateGdiMetafile " << std::hex << hr; | 521 LOG(ERROR) << "Failed to CreateGdiMetafile " << std::hex << hr; |
522 return hr; | 522 return hr; |
523 } | 523 } |
524 return hr; | 524 return hr; |
525 } | 525 } |
526 | 526 |
527 } // namespace metro_driver | 527 } // namespace metro_driver |
OLD | NEW |