[M120 Migration][VD] Remove accessing oom_score_adj in zygote process
[platform/framework/web/chromium-efl.git] / printing / printed_document_win.cc
1 // Copyright 2011 The Chromium Authors
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 "printing/printed_document.h"
6
7 #include "base/check.h"
8 #include "base/synchronization/lock.h"
9 #include "printing/mojom/print.mojom.h"
10 #include "printing/printed_page_win.h"
11 #include "printing/printing_context.h"
12
13 namespace printing {
14
15 #if !defined(NDEBUG)
16 bool PrintedDocument::IsPageInList(const PrintedPage& page) const {
17   // Make sure the page is from our list.
18   base::AutoLock lock(lock_);
19   return &page == mutable_.pages_.find(page.page_number() - 1)->second.get();
20 }
21 #endif
22
23 mojom::ResultCode PrintedDocument::RenderPrintedPage(
24     const PrintedPage& page,
25     PrintingContext* context) const {
26 #if !defined(NDEBUG)
27   DCHECK(IsPageInList(page));
28 #endif
29
30   DCHECK(context);
31   mojom::ResultCode result = context->RenderPage(
32       page, immutable_.settings_->page_setup_device_units());
33   if (result != mojom::ResultCode::kSuccess)
34     return result;
35
36   // Beware of any asynchronous aborts of the print job that happened during
37   // printing.
38   if (context->PrintingAborted())
39     return mojom::ResultCode::kCanceled;
40
41   return mojom::ResultCode::kSuccess;
42 }
43
44 }  // namespace printing