Index: chrome/browser/extensions/api/streams_private/streams_private_api.h |
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_api.h b/chrome/browser/extensions/api/streams_private/streams_private_api.h |
index 36f560d1b9475a1d6be61283930e7ae396c88276..fbacbff6fe27386089933bbed194da7f53d39ea4 100644 |
--- a/chrome/browser/extensions/api/streams_private/streams_private_api.h |
+++ b/chrome/browser/extensions/api/streams_private/streams_private_api.h |
@@ -19,18 +19,41 @@ |
class Profile; |
+namespace content { |
+class StreamHandle; |
+} |
+ |
namespace extensions { |
-class StreamsPrivateAPI : public ProfileKeyedAPI { |
+class StreamsPrivateAPI : public ProfileKeyedAPI, |
+ public content::NotificationObserver { |
public: |
+ // Convenience method to get the StreamsPrivateAPI for a profile. |
+ static StreamsPrivateAPI* Get(Profile* profile); |
+ |
explicit StreamsPrivateAPI(Profile* profile); |
virtual ~StreamsPrivateAPI(); |
+ void ExecuteMimeTypeHandler(const std::string& extension_id, |
+ scoped_ptr<content::StreamHandle> stream, |
+ const std::string& mime_type, |
+ const GURL& original_url); |
+ |
// ProfileKeyedAPI implementation. |
static ProfileKeyedAPIFactory<StreamsPrivateAPI>* GetFactoryInstance(); |
+ // content::NotificationObserver implementation. |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) OVERRIDE; |
+ |
private: |
friend class ProfileKeyedAPIFactory<StreamsPrivateAPI>; |
+ typedef std::map<std::string, |
+ std::map<GURL, |
+ linked_ptr<content::StreamHandle> > > StreamMap; |
+ |
+ void OnStreamClosed(const std::string& extension_id, const GURL& url); |
// ProfileKeyedAPI implementation. |
static const char* service_name() { |
@@ -39,6 +62,9 @@ class StreamsPrivateAPI : public ProfileKeyedAPI { |
static const bool kServiceIsNULLWhileTesting = true; |
Profile* const profile_; |
+ content::NotificationRegistrar registrar_; |
+ StreamMap streams_; |
+ base::WeakPtrFactory<StreamsPrivateAPI> weak_ptr_factory_; |
}; |
} // namespace extensions |