| 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 | 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "core/frame/LocalFrame.h" | 28 #include "core/frame/LocalFrame.h" |
| 29 #include "modules/mediastream/UserMediaClient.h" | 29 #include "modules/mediastream/UserMediaClient.h" |
| 30 #include "wtf/PassOwnPtr.h" | 30 #include "wtf/PassOwnPtr.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 class MediaDevicesRequest; | 34 class MediaDevicesRequest; |
| 35 class UserMediaRequest; | 35 class UserMediaRequest; |
| 36 | 36 |
| 37 class UserMediaController FINAL : public Supplement<LocalFrame> { | 37 class UserMediaController FINAL : public NoBaseWillBeGarbageCollected<UserMediaC
ontroller>, public WillBeHeapSupplement<LocalFrame> { |
| 38 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(UserMediaController); |
| 39 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(); |
| 38 public: | 40 public: |
| 39 virtual ~UserMediaController(); | |
| 40 | 41 |
| 41 UserMediaClient* client() const { return m_client; } | 42 UserMediaClient* client() const { return m_client; } |
| 42 | 43 |
| 43 void requestUserMedia(PassRefPtrWillBeRawPtr<UserMediaRequest>); | 44 void requestUserMedia(PassRefPtrWillBeRawPtr<UserMediaRequest>); |
| 44 void cancelUserMediaRequest(UserMediaRequest*); | 45 void cancelUserMediaRequest(UserMediaRequest*); |
| 45 | 46 |
| 46 void requestMediaDevices(PassRefPtrWillBeRawPtr<MediaDevicesRequest>); | 47 void requestMediaDevices(PassRefPtrWillBeRawPtr<MediaDevicesRequest>); |
| 47 void cancelMediaDevicesRequest(MediaDevicesRequest*); | 48 void cancelMediaDevicesRequest(MediaDevicesRequest*); |
| 48 | 49 |
| 49 static PassOwnPtr<UserMediaController> create(UserMediaClient*); | 50 static PassOwnPtrWillBeRawPtr<UserMediaController> create(UserMediaClient*); |
| 50 static const char* supplementName(); | 51 static const char* supplementName(); |
| 51 static UserMediaController* from(LocalFrame* frame) { return static_cast<Use
rMediaController*>(Supplement<LocalFrame>::from(frame, supplementName())); } | 52 static UserMediaController* from(LocalFrame* frame) { return static_cast<Use
rMediaController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName(
))); } |
| 52 | 53 |
| 53 virtual void trace(Visitor* visitor) OVERRIDE { Supplement<LocalFrame>::trac
e(visitor); } | 54 virtual void trace(Visitor* visitor) OVERRIDE { WillBeHeapSupplement<LocalFr
ame>::trace(visitor); } |
| 54 | 55 |
| 55 protected: | 56 protected: |
| 56 explicit UserMediaController(UserMediaClient*); | 57 explicit UserMediaController(UserMediaClient*); |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 UserMediaClient* m_client; | 60 UserMediaClient* m_client; |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 inline void UserMediaController::requestUserMedia(PassRefPtrWillBeRawPtr<UserMed
iaRequest> request) | 63 inline void UserMediaController::requestUserMedia(PassRefPtrWillBeRawPtr<UserMed
iaRequest> request) |
| 63 { | 64 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 75 } | 76 } |
| 76 | 77 |
| 77 inline void UserMediaController::cancelMediaDevicesRequest(MediaDevicesRequest*
request) | 78 inline void UserMediaController::cancelMediaDevicesRequest(MediaDevicesRequest*
request) |
| 78 { | 79 { |
| 79 m_client->cancelMediaDevicesRequest(request); | 80 m_client->cancelMediaDevicesRequest(request); |
| 80 } | 81 } |
| 81 | 82 |
| 82 } // namespace WebCore | 83 } // namespace WebCore |
| 83 | 84 |
| 84 #endif // UserMediaController_h | 85 #endif // UserMediaController_h |
| OLD | NEW |