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

Side by Side Diff: chrome/utility/media_galleries/ipc_data_source.h

Issue 103283003: Media Galleries API Metadata: SafeMediaMetadataParser and IPCTunnelDataReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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_DATA_SOURCE_H_
6 #define CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_
7
8 #include <map>
9 #include <string>
10
11 #include "chrome/utility/utility_message_handler.h"
12 #include "media/base/data_source.h"
13
14 namespace metadata {
15
16 // Provides the metadata parser with bytes from the browser process via IPC.
17 class IPCDataSource: public media::DataSource,
18 public chrome::UtilityMessageHandler {
19 public:
20 explicit IPCDataSource(int64 total_size);
21 virtual ~IPCDataSource();
22
23 // Implementation of DataSource.
24 virtual void set_host(media::DataSourceHost* host) OVERRIDE;
25 virtual void Stop(const base::Closure& callback) OVERRIDE;
26 virtual void Read(int64 position, int size, uint8* data,
27 const ReadCB& read_cb) OVERRIDE;
28 virtual bool GetSize(int64* size_out) OVERRIDE;
29 virtual bool IsStreaming() OVERRIDE;
30 virtual void SetBitrate(int bitrate) OVERRIDE;
31
32 // Implementation of UtilityMessageHandler.
33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
34
35 private:
36 struct Request {
37 Request();
38 ~Request();
39 uint8* destination;
40 ReadCB callback;
41 };
42
43 void OnRequestBlobBytesFinished(int64 request_id,
44 const std::string& bytes);
45
46 const int64 total_size_;
47 std::map<int64, Request> pending_requests_;
48 int64 next_request_id_;
49 };
50
51 } // namespace metadata
52
53 #endif // CHROME_UTILITY_MEDIA_GALLERIES_IPC_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « chrome/utility/chrome_content_utility_client.cc ('k') | chrome/utility/media_galleries/ipc_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698