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

Side by Side Diff: device/devices_app/devices_app.cc

Issue 1266643003: ApplicationImpl cleanup, part 1: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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 | « content/public/test/test_mojo_app.cc ('k') | mandoline/ui/browser/browser_manager.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "device/devices_app/devices_app.h" 5 #include "device/devices_app/devices_app.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // If the last DeviceManager connection has been dropped, kick off an idle 149 // If the last DeviceManager connection has been dropped, kick off an idle
150 // timeout to shut ourselves down. 150 // timeout to shut ourselves down.
151 StartIdleTimer(); 151 StartIdleTimer();
152 } 152 }
153 } 153 }
154 154
155 void DevicesApp::StartIdleTimer() { 155 void DevicesApp::StartIdleTimer() {
156 // Passing unretained |app_impl_| is safe here because |app_impl_| is 156 // Passing unretained |app_impl_| is safe here because |app_impl_| is
157 // guaranteed to outlive |this|, and the callback is canceled if |this| is 157 // guaranteed to outlive |this|, and the callback is canceled if |this| is
158 // destroyed. 158 // destroyed.
159 idle_timeout_callback_.Reset(base::Bind(&mojo::ApplicationImpl::Terminate, 159 idle_timeout_callback_.Reset(base::Bind(&mojo::ApplicationImpl::Quit,
160 base::Unretained(app_impl_))); 160 base::Unretained(app_impl_)));
161 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 161 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
162 FROM_HERE, idle_timeout_callback_.callback(), 162 FROM_HERE, idle_timeout_callback_.callback(),
163 base::TimeDelta::FromSeconds(kIdleTimeoutInSeconds)); 163 base::TimeDelta::FromSeconds(kIdleTimeoutInSeconds));
164 } 164 }
165 165
166 } // namespace device 166 } // namespace device
OLDNEW
« no previous file with comments | « content/public/test/test_mojo_app.cc ('k') | mandoline/ui/browser/browser_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698