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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_gallery/linux/mtp_device_operations_utils.h
diff --git a/chrome/browser/media_gallery/linux/mtp_device_operations_utils.h b/chrome/browser/media_gallery/linux/mtp_device_operations_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ba22ccf65db38d28ff53db611d60270794dd822
--- /dev/null
+++ b/chrome/browser/media_gallery/linux/mtp_device_operations_utils.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// MTPDeviceOperationsUtils provides support to media transfer protocol device
+// file operation worker classes.
+
+#ifndef CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OPERATIONS_UTILS_H_
+#define CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OPERATIONS_UTILS_H_
+
+#include "base/location.h"
+#include "base/logging.h"
+#include "base/sequenced_task_runner.h"
+#include "base/sequenced_task_runner_helpers.h"
+#include "base/threading/sequenced_worker_pool.h"
+
+namespace chrome {
+
+class MediaTransferProtocolManager;
+
+// Helper struct to delete worker objects on |media_task_runner_| thread.
+template <typename WORKER> struct WorkerDeleter {
+ static void Destruct(const WORKER* worker) {
+ if (!worker->media_task_runner()->RunsTasksOnCurrentThread()) {
+ worker->media_task_runner()->DeleteSoon(FROM_HERE, worker);
+ return;
+ }
+ delete worker;
+ }
+};
+
+// Returns MediaTransferProtocolManager instance on success or NULL on failure.
+MediaTransferProtocolManager* GetMediaTransferProtocolManager();
+
+} // namespace chrome
+
+#endif // CHROME_BROWSER_MEDIA_GALLERY_LINUX_MTP_DEVICE_OPERATIONS_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698