Index: chrome/browser/extensions/api/streams_private/streams_private_api.cc |
diff --git a/chrome/browser/extensions/api/streams_private/streams_private_api.cc b/chrome/browser/extensions/api/streams_private/streams_private_api.cc |
index 1a1445aa22925b168ad253beb2b155b391d3f27b..d04ca80e08c2347f46917b50f12177a2224aa373 100644 |
--- a/chrome/browser/extensions/api/streams_private/streams_private_api.cc |
+++ b/chrome/browser/extensions/api/streams_private/streams_private_api.cc |
@@ -88,6 +88,13 @@ void StreamsPrivateAPI::ExecuteMimeTypeHandler( |
streams_[extension_id][url] = make_linked_ptr(stream.release()); |
} |
+void StreamsPrivateAPI::AbortStream(const std::string& extension_id, |
+ const GURL& stream_url) { |
+ StreamMap::iterator it = streams_.find(extension_id); |
+ if (it != streams_.end()) |
+ it->second.erase(stream_url); |
+} |
+ |
void StreamsPrivateAPI::OnExtensionUnloaded( |
content::BrowserContext* browser_context, |
const Extension* extension, |
@@ -95,6 +102,20 @@ void StreamsPrivateAPI::OnExtensionUnloaded( |
streams_.erase(extension->id()); |
} |
+StreamsPrivateAbortFunction::StreamsPrivateAbortFunction() { |
+} |
+ |
+bool StreamsPrivateAbortFunction::Prepare() { |
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &stream_url_)); |
+ StreamsPrivateAPI::Get(browser_context())->AbortStream(extension_id(), |
+ GURL(stream_url_)); |
+ return true; |
+} |
+ |
+bool StreamsPrivateAbortFunction::Respond() { |
+ return true; |
+} |
+ |
static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > |
g_factory = LAZY_INSTANCE_INITIALIZER; |