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/tab_capture/tab_capture_registry.h" | 5 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 continue; | 278 continue; |
279 tab_capture::CaptureInfo info; | 279 tab_capture::CaptureInfo info; |
280 request->GetCaptureInfo(&info); | 280 request->GetCaptureInfo(&info); |
281 list_of_capture_info->Append(info.ToValue()); | 281 list_of_capture_info->Append(info.ToValue()); |
282 } | 282 } |
283 } | 283 } |
284 | 284 |
285 void TabCaptureRegistry::OnExtensionUnloaded( | 285 void TabCaptureRegistry::OnExtensionUnloaded( |
286 content::BrowserContext* browser_context, | 286 content::BrowserContext* browser_context, |
287 const Extension* extension, | 287 const Extension* extension, |
288 UnloadedExtensionInfo::Reason reason) { | 288 UnloadedExtensionReason reason) { |
289 // Cleanup all the requested media streams for this extension. | 289 // Cleanup all the requested media streams for this extension. |
290 for (std::vector<std::unique_ptr<LiveRequest>>::iterator it = | 290 for (std::vector<std::unique_ptr<LiveRequest>>::iterator it = |
291 requests_.begin(); | 291 requests_.begin(); |
292 it != requests_.end();) { | 292 it != requests_.end();) { |
293 if ((*it)->extension_id() == extension->id()) { | 293 if ((*it)->extension_id() == extension->id()) { |
294 it = requests_.erase(it); | 294 it = requests_.erase(it); |
295 } else { | 295 } else { |
296 ++it; | 296 ++it; |
297 } | 297 } |
298 } | 298 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 it != requests_.end(); ++it) { | 463 it != requests_.end(); ++it) { |
464 if (it->get() == request) { | 464 if (it->get() == request) { |
465 requests_.erase(it); | 465 requests_.erase(it); |
466 return; | 466 return; |
467 } | 467 } |
468 } | 468 } |
469 NOTREACHED(); | 469 NOTREACHED(); |
470 } | 470 } |
471 | 471 |
472 } // namespace extensions | 472 } // namespace extensions |
OLD | NEW |