Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: chrome/browser/printing/print_view_manager_base.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_manager.h ('k') | chrome/browser/process_singleton_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_view_manager_base.h" 5 #include "chrome/browser/printing/print_view_manager_base.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 // - If we're looping because of printer settings initialization, the premise 443 // - If we're looping because of printer settings initialization, the premise
444 // here is that some poor users have their print server away on a VPN over a 444 // here is that some poor users have their print server away on a VPN over a
445 // slow connection. In this situation, the simple fact of opening the printer 445 // slow connection. In this situation, the simple fact of opening the printer
446 // can be dead slow. On the other side, we don't want to die infinitely for a 446 // can be dead slow. On the other side, we don't want to die infinitely for a
447 // real network error. Give the printer 60 seconds to comply. 447 // real network error. Give the printer 60 seconds to comply.
448 // 448 //
449 // - If we're looping because of renderer page generation, the renderer could 449 // - If we're looping because of renderer page generation, the renderer could
450 // be CPU bound, the page overly complex/large or the system just 450 // be CPU bound, the page overly complex/large or the system just
451 // memory-bound. 451 // memory-bound.
452 static const int kPrinterSettingsTimeout = 60000; 452 static const int kPrinterSettingsTimeout = 60000;
453 base::OneShotTimer<base::MessageLoop> quit_timer; 453 base::OneShotTimer quit_timer;
454 quit_timer.Start(FROM_HERE, 454 quit_timer.Start(FROM_HERE,
455 TimeDelta::FromMilliseconds(kPrinterSettingsTimeout), 455 TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
456 base::MessageLoop::current(), &base::MessageLoop::Quit); 456 base::MessageLoop::current(), &base::MessageLoop::Quit);
457 457
458 inside_inner_message_loop_ = true; 458 inside_inner_message_loop_ = true;
459 459
460 // Need to enable recursive task. 460 // Need to enable recursive task.
461 { 461 {
462 base::MessageLoop::ScopedNestableTaskAllower allow( 462 base::MessageLoop::ScopedNestableTaskAllower allow(
463 base::MessageLoop::current()); 463 base::MessageLoop::current());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 scoped_refptr<printing::PrinterQuery> printer_query; 528 scoped_refptr<printing::PrinterQuery> printer_query;
529 printer_query = queue_->PopPrinterQuery(cookie); 529 printer_query = queue_->PopPrinterQuery(cookie);
530 if (!printer_query.get()) 530 if (!printer_query.get())
531 return; 531 return;
532 BrowserThread::PostTask( 532 BrowserThread::PostTask(
533 BrowserThread::IO, FROM_HERE, 533 BrowserThread::IO, FROM_HERE,
534 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); 534 base::Bind(&PrinterQuery::StopWorker, printer_query.get()));
535 } 535 }
536 536
537 } // namespace printing 537 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_manager.h ('k') | chrome/browser/process_singleton_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698