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

Side by Side Diff: chrome/browser/media_gallery/linux/mtp_device_operations_utils.h

Issue 11348337: Move MTPDeviceDelegateImplLinux worker classes to its own files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments Created 8 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // MTPDeviceOperationsUtils provides support to media transfer protocol device
6 // file operation worker classes.
7
8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OPERATIONS_UTILS_H_
9 #define CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OPERATIONS_UTILS_H_
10
11 #include "base/location.h"
12 #include "base/logging.h"
13 #include "base/sequenced_task_runner.h"
14 #include "base/sequenced_task_runner_helpers.h"
15 #include "base/threading/sequenced_worker_pool.h"
16
17 namespace chrome {
18
19 class MediaTransferProtocolManager;
20
21 // Helper struct to delete worker objects on |media_task_runner_| thread.
22 template <typename WORKER> struct WorkerDeleter {
23 static void Destruct(const WORKER* worker) {
24 if (!worker->media_task_runner()->RunsTasksOnCurrentThread()) {
25 worker->media_task_runner()->DeleteSoon(FROM_HERE, worker);
26 return;
27 }
28 delete worker;
29 }
30 };
31
32 // Returns MediaTransferProtocolManager instance on success or NULL on failure.
33 MediaTransferProtocolManager* GetMediaTransferProtocolManager();
34
35 } // namespace chrome
36
37 #endif // CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OPERATIONS_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698