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 "chrome/browser/printing/print_job_manager.h" | 5 #include "chrome/browser/printing/print_job_manager.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/printing/print_job.h" | 8 #include "chrome/browser/printing/print_job.h" |
9 #include "chrome/browser/printing/printer_query.h" | 9 #include "chrome/browser/printing/printer_query.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 if ((*itr)->cookie() == document_cookie && !(*itr)->is_callback_pending()) { | 42 if ((*itr)->cookie() == document_cookie && !(*itr)->is_callback_pending()) { |
43 scoped_refptr<printing::PrinterQuery> current_query(*itr); | 43 scoped_refptr<printing::PrinterQuery> current_query(*itr); |
44 queued_queries_.erase(itr); | 44 queued_queries_.erase(itr); |
45 DCHECK(current_query->is_valid()); | 45 DCHECK(current_query->is_valid()); |
46 return current_query; | 46 return current_query; |
47 } | 47 } |
48 } | 48 } |
49 return NULL; | 49 return NULL; |
50 } | 50 } |
51 | 51 |
52 scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery( | 52 scoped_refptr<PrinterQuery> PrintQueriesQueue::CreatePrinterQuery() { |
53 int render_process_id, | 53 scoped_refptr<PrinterQuery> job = new printing::PrinterQuery; |
54 int render_view_id) { | |
55 scoped_refptr<PrinterQuery> job = | |
56 new printing::PrinterQuery(render_process_id, render_view_id); | |
57 base::AutoLock lock(lock_); | 54 base::AutoLock lock(lock_); |
58 job->SetWorkerDestination(destination_); | 55 job->SetWorkerDestination(destination_); |
59 return job; | 56 return job; |
60 } | 57 } |
61 | 58 |
62 void PrintQueriesQueue::Shutdown() { | 59 void PrintQueriesQueue::Shutdown() { |
63 PrinterQueries queries_to_stop; | 60 PrinterQueries queries_to_stop; |
64 { | 61 { |
65 base::AutoLock lock(lock_); | 62 base::AutoLock lock(lock_); |
66 queued_queries_.swap(queries_to_stop); | 63 queued_queries_.swap(queries_to_stop); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 break; | 160 break; |
164 } | 161 } |
165 default: { | 162 default: { |
166 NOTREACHED(); | 163 NOTREACHED(); |
167 break; | 164 break; |
168 } | 165 } |
169 } | 166 } |
170 } | 167 } |
171 | 168 |
172 } // namespace printing | 169 } // namespace printing |
OLD | NEW |