OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_UTILITY_MEDIA_GALLERIES_IPC_TUNNEL_DATA_READER_H_ |
| 6 #define CHROME_UTILITY_MEDIA_GALLERIES_IPC_TUNNEL_DATA_READER_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "chrome/utility/media_galleries/media_metadata_parser.h" |
| 11 |
| 12 namespace metadata { |
| 13 |
| 14 // Provides the metadata parser with bytes from the browser process via IPC. |
| 15 class IPCTunnelDataReader : public metadata::DataReader { |
| 16 public: |
| 17 IPCTunnelDataReader(); |
| 18 virtual ~IPCTunnelDataReader(); |
| 19 |
| 20 virtual void ReadBytes(int64 offset, int64 length, |
| 21 const ReadBytesCallback& callback) OVERRIDE; |
| 22 |
| 23 // Called by ChromeContentUtilityClient when it recieves the requested bytes. |
| 24 void ReceiveBytes(int64 request_id, const std::string& bytes); |
| 25 |
| 26 private: |
| 27 std::map<int64, ReadBytesCallback> pending_callbacks_; |
| 28 int64 next_request_id_; |
| 29 }; |
| 30 |
| 31 } // namespace metadata |
| 32 |
| 33 #endif // CHROME_UTILITY_MEDIA_GALLERIES_IPC_TUNNEL_DATA_READER_H_ |
OLD | NEW |