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

Unified Diff: chrome/utility/media_galleries/ipc_tunnel_data_reader.h

Issue 103283003: Media Galleries API Metadata: SafeMediaMetadataParser and IPCTunnelDataReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self review 2 Created 7 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/utility/media_galleries/ipc_tunnel_data_reader.h
diff --git a/chrome/utility/media_galleries/ipc_tunnel_data_reader.h b/chrome/utility/media_galleries/ipc_tunnel_data_reader.h
new file mode 100644
index 0000000000000000000000000000000000000000..7077e0114e40db225974f3c21ca32936d9068c12
--- /dev/null
+++ b/chrome/utility/media_galleries/ipc_tunnel_data_reader.h
@@ -0,0 +1,33 @@
+// Copyright 2013 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.
+
+#ifndef CHROME_UTILITY_MEDIA_GALLERIES_IPC_TUNNEL_DATA_READER_H_
+#define CHROME_UTILITY_MEDIA_GALLERIES_IPC_TUNNEL_DATA_READER_H_
+
+#include <map>
+
+#include "chrome/utility/media_galleries/media_metadata_parser.h"
+
+namespace metadata {
+
+// Provides the metadata parser with bytes from the browser process via IPC.
+class IPCTunnelDataReader : public metadata::DataReader {
+ public:
+ IPCTunnelDataReader();
+ virtual ~IPCTunnelDataReader();
+
+ virtual void ReadBytes(int64 offset, int64 length,
+ const ReadBytesCallback& callback) OVERRIDE;
+
+ // Called by ChromeContentUtilityClient when it recieves the requested bytes.
+ void ReceiveBytes(int64 request_id, const std::string& bytes);
+
+ private:
+ std::map<int64, ReadBytesCallback> pending_callbacks_;
+ int64 next_request_id_;
+};
+
+} // namespace metadata
+
+#endif // CHROME_UTILITY_MEDIA_GALLERIES_IPC_TUNNEL_DATA_READER_H_

Powered by Google App Engine
This is Rietveld 408576698