| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/streams_private/streams_private_api.h" | 5 #include "chrome/browser/extensions/api/streams_private/streams_private_api.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 std::unique_ptr<Event> event( | 129 std::unique_ptr<Event> event( |
| 130 new Event(events::STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER, | 130 new Event(events::STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER, |
| 131 streams_private::OnExecuteMimeTypeHandler::kEventName, | 131 streams_private::OnExecuteMimeTypeHandler::kEventName, |
| 132 streams_private::OnExecuteMimeTypeHandler::Create(info))); | 132 streams_private::OnExecuteMimeTypeHandler::Create(info))); |
| 133 | 133 |
| 134 EventRouter::Get(browser_context_) | 134 EventRouter::Get(browser_context_) |
| 135 ->DispatchEventToExtension(extension_id, std::move(event)); | 135 ->DispatchEventToExtension(extension_id, std::move(event)); |
| 136 | 136 |
| 137 GURL url = stream->handle->GetURL(); | 137 GURL url = stream->handle->GetURL(); |
| 138 streams_[extension_id][url] = make_linked_ptr(stream->handle.release()); | 138 streams_[extension_id][url] = std::move(stream->handle); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void StreamsPrivateAPI::AbortStream(const std::string& extension_id, | 141 void StreamsPrivateAPI::AbortStream(const std::string& extension_id, |
| 142 const GURL& stream_url, | 142 const GURL& stream_url, |
| 143 const base::Closure& callback) { | 143 const base::Closure& callback) { |
| 144 StreamMap::iterator extension_it = streams_.find(extension_id); | 144 StreamMap::iterator extension_it = streams_.find(extension_id); |
| 145 if (extension_it == streams_.end()) { | 145 if (extension_it == streams_.end()) { |
| 146 callback.Run(); | 146 callback.Run(); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > | 185 static base::LazyInstance<BrowserContextKeyedAPIFactory<StreamsPrivateAPI> > |
| 186 g_factory = LAZY_INSTANCE_INITIALIZER; | 186 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 187 | 187 |
| 188 // static | 188 // static |
| 189 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* | 189 BrowserContextKeyedAPIFactory<StreamsPrivateAPI>* |
| 190 StreamsPrivateAPI::GetFactoryInstance() { | 190 StreamsPrivateAPI::GetFactoryInstance() { |
| 191 return g_factory.Pointer(); | 191 return g_factory.Pointer(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace extensions | 194 } // namespace extensions |
| OLD | NEW |