OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "modules/mediastream/MediaStreamTrackSourcesRequestImpl.h" | 27 #include "modules/mediastream/MediaStreamTrackSourcesRequestImpl.h" |
28 | 28 |
29 #include "core/dom/CrossThreadTask.h" | 29 #include "core/dom/CrossThreadTask.h" |
30 #include "core/dom/ExecutionContext.h" | 30 #include "core/dom/ExecutionContext.h" |
31 #include "modules/mediastream/MediaStreamTrackSourcesCallback.h" | 31 #include "modules/mediastream/MediaStreamTrackSourcesCallback.h" |
32 #include "platform/weborigin/SecurityOrigin.h" | 32 #include "platform/weborigin/SecurityOrigin.h" |
33 #include "public/platform/WebSourceInfo.h" | 33 #include "public/platform/WebSourceInfo.h" |
| 34 #include "public/platform/WebTraceLocation.h" |
34 #include "wtf/Functional.h" | 35 #include "wtf/Functional.h" |
35 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 MediaStreamTrackSourcesRequestImpl* MediaStreamTrackSourcesRequestImpl::create(E
xecutionContext& context, MediaStreamTrackSourcesCallback* callback) | 40 MediaStreamTrackSourcesRequestImpl* MediaStreamTrackSourcesRequestImpl::create(E
xecutionContext& context, MediaStreamTrackSourcesCallback* callback) |
40 { | 41 { |
41 return new MediaStreamTrackSourcesRequestImpl(context, callback); | 42 return new MediaStreamTrackSourcesRequestImpl(context, callback); |
42 } | 43 } |
43 | 44 |
(...skipping 11 matching lines...) Expand all Loading... |
55 { | 56 { |
56 return m_executionContext->securityOrigin()->toString(); | 57 return m_executionContext->securityOrigin()->toString(); |
57 } | 58 } |
58 | 59 |
59 void MediaStreamTrackSourcesRequestImpl::requestSucceeded(const WebVector<WebSou
rceInfo>& webSourceInfos) | 60 void MediaStreamTrackSourcesRequestImpl::requestSucceeded(const WebVector<WebSou
rceInfo>& webSourceInfos) |
60 { | 61 { |
61 ASSERT(m_callback); | 62 ASSERT(m_callback); |
62 | 63 |
63 for (size_t i = 0; i < webSourceInfos.size(); ++i) | 64 for (size_t i = 0; i < webSourceInfos.size(); ++i) |
64 m_sourceInfos.append(SourceInfo::create(webSourceInfos[i])); | 65 m_sourceInfos.append(SourceInfo::create(webSourceInfos[i])); |
65 m_executionContext->postTask(createCrossThreadTask(&MediaStreamTrackSourcesR
equestImpl::performCallback, this)); | 66 m_executionContext->postTask(FROM_HERE, createCrossThreadTask(&MediaStreamTr
ackSourcesRequestImpl::performCallback, this)); |
66 } | 67 } |
67 | 68 |
68 void MediaStreamTrackSourcesRequestImpl::performCallback() | 69 void MediaStreamTrackSourcesRequestImpl::performCallback() |
69 { | 70 { |
70 m_callback->handleEvent(m_sourceInfos); | 71 m_callback->handleEvent(m_sourceInfos); |
71 m_callback.clear(); | 72 m_callback.clear(); |
72 } | 73 } |
73 | 74 |
74 DEFINE_TRACE(MediaStreamTrackSourcesRequestImpl) | 75 DEFINE_TRACE(MediaStreamTrackSourcesRequestImpl) |
75 { | 76 { |
76 visitor->trace(m_callback); | 77 visitor->trace(m_callback); |
77 visitor->trace(m_executionContext); | 78 visitor->trace(m_executionContext); |
78 visitor->trace(m_sourceInfos); | 79 visitor->trace(m_sourceInfos); |
79 MediaStreamTrackSourcesRequest::trace(visitor); | 80 MediaStreamTrackSourcesRequest::trace(visitor); |
80 } | 81 } |
81 | 82 |
82 } // namespace blink | 83 } // namespace blink |
OLD | NEW |