OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "modules/mediasource/MediaSourceRegistry.h" | 31 #include "modules/mediasource/MediaSourceRegistry.h" |
32 | 32 |
33 #include "modules/mediasource/MediaSource.h" | 33 #include "modules/mediasource/MediaSource.h" |
34 #include "platform/weborigin/KURL.h" | 34 #include "platform/weborigin/KURL.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 MediaSourceRegistry& MediaSourceRegistry::registry() { | 38 MediaSourceRegistry& MediaSourceRegistry::registry() { |
39 DCHECK(isMainThread()); | 39 DCHECK(isMainThread()); |
| 40 ALLOW_UNSAFE_SINGLETON() |
40 DEFINE_STATIC_LOCAL(MediaSourceRegistry, instance, ()); | 41 DEFINE_STATIC_LOCAL(MediaSourceRegistry, instance, ()); |
41 return instance; | 42 return instance; |
42 } | 43 } |
43 | 44 |
44 void MediaSourceRegistry::registerURL(SecurityOrigin*, | 45 void MediaSourceRegistry::registerURL(SecurityOrigin*, |
45 const KURL& url, | 46 const KURL& url, |
46 URLRegistrable* registrable) { | 47 URLRegistrable* registrable) { |
47 DCHECK_EQ(®istrable->registry(), this); | 48 DCHECK_EQ(®istrable->registry(), this); |
48 DCHECK(isMainThread()); | 49 DCHECK(isMainThread()); |
49 | 50 |
(...skipping 17 matching lines...) Expand all Loading... |
67 URLRegistrable* MediaSourceRegistry::lookup(const String& url) { | 68 URLRegistrable* MediaSourceRegistry::lookup(const String& url) { |
68 DCHECK(isMainThread()); | 69 DCHECK(isMainThread()); |
69 return url.isNull() ? nullptr : m_mediaSources.get(url); | 70 return url.isNull() ? nullptr : m_mediaSources.get(url); |
70 } | 71 } |
71 | 72 |
72 MediaSourceRegistry::MediaSourceRegistry() { | 73 MediaSourceRegistry::MediaSourceRegistry() { |
73 HTMLMediaSource::setRegistry(this); | 74 HTMLMediaSource::setRegistry(this); |
74 } | 75 } |
75 | 76 |
76 } // namespace blink | 77 } // namespace blink |
OLD | NEW |