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

Unified Diff: chrome/browser/extensions/api/streams_private/streams_private_api.h

Issue 12645004: Add Resource Handler for creating Streams to forward to extensions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable Stream Resource Throttle Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/streams_private/streams_private_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e792c91cb55e44c0c0d40ecb409575955196cfbb 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,37 @@
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);
+
// 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;
// ProfileKeyedAPI implementation.
static const char* service_name() {
@@ -39,6 +58,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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/streams_private/streams_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698