WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 130689
Add platform implementation for RTCOfferAnswerOptions and RTCOfferOptions
https://bugs.webkit.org/show_bug.cgi?id=130689
Summary
Add platform implementation for RTCOfferAnswerOptions and RTCOfferOptions
Thiago de Barros Lacerda
Reported
2014-03-24 11:44:25 PDT
RTCOfferAnswerOptions and RTCOfferOptions objects were being passed to platform class, causing a layer violation.
Attachments
Patch
(17.67 KB, patch)
2014-03-24 12:02 PDT
,
Thiago de Barros Lacerda
eric.carlson
: review+
Details
Formatted Diff
Diff
Requested changes
(17.57 KB, patch)
2014-03-26 15:02 PDT
,
Thiago de Barros Lacerda
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Thiago de Barros Lacerda
Comment 1
2014-03-24 12:02:30 PDT
Created
attachment 227675
[details]
Patch
Eric Carlson
Comment 2
2014-03-24 14:58:44 PDT
Comment on
attachment 227675
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227675&action=review
> Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp:78 > + RefPtr<RTCOfferOptionsPrivate> optionsPrivate = RTCOfferOptionsPrivate::create(); > + m_private = optionsPrivate;
Nit: is the local variable necessary?
> Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h:54 > -private: > - String m_requestIdentity; > + RefPtr<RTCOfferAnswerOptionsPrivate> m_private;
This should remain private.
> Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h:64 > + int64_t offerToReceiveVideo() const { return static_cast<RTCOfferOptionsPrivate*>(m_private.get())->offerToReceiveVideo(); } > + int64_t offerToReceiveAudio() const { return static_cast<RTCOfferOptionsPrivate*>(m_private.get())->offerToReceiveAudio(); } > + bool voiceActivityDetection() const { return static_cast<RTCOfferOptionsPrivate*>(m_private.get())->voiceActivityDetection(); } > + bool iceRestart() const { return static_cast<RTCOfferOptionsPrivate*>(m_private.get())->iceRestart(); }
Are these static_casts necessary? If so, please put the accessor privateOfferOptions() in the base class and use it.
> Source/WebCore/platform/mediastream/RTCOfferAnswerOptionsPrivate.h:53 > + return;
This should be indented.
Thiago de Barros Lacerda
Comment 3
2014-03-24 16:31:58 PDT
Comment on
attachment 227675
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227675&action=review
>> Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp:78 >> + m_private = optionsPrivate; > > Nit: is the local variable necessary?
It is just to avoid an static_cast to access RTCOfferOptionsPrivate methods (since m_private is an instance of the base class RTCOfferAnswerOptionsPrivate).
>> Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h:64 >> + bool iceRestart() const { return static_cast<RTCOfferOptionsPrivate*>(m_private.get())->iceRestart(); } > > Are these static_casts necessary? If so, please put the accessor privateOfferOptions() in the base class and use it.
I don't think that the base class should no about anyone that derives from it. Putting privateOfferOptions in the base class seems like to add extra information on the base class that it should not know. And yes, these casts are necessary, m_private is declared as the base class.
>> Source/WebCore/platform/mediastream/RTCOfferAnswerOptionsPrivate.h:53 >> + return; > > This should be indented.
oops
Eric Carlson
Comment 4
2014-03-25 07:42:11 PDT
Comment on
attachment 227675
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=227675&action=review
>>> Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h:64 >>> + bool iceRestart() const { return static_cast<RTCOfferOptionsPrivate*>(m_private.get())->iceRestart(); } >> >> Are these static_casts necessary? If so, please put the accessor privateOfferOptions() in the base class and use it. > > I don't think that the base class should no about anyone that derives from it. Putting privateOfferOptions in the base class seems like to add extra information on the base class that it should not know. > And yes, these casts are necessary, m_private is declared as the base class.
Then I suggest having an privateOfferAnswer() in the base class, use that in privateOfferOptions() here, and use privateOfferOptions in these methods.
Thiago de Barros Lacerda
Comment 5
2014-03-26 15:02:41 PDT
Created
attachment 227889
[details]
Requested changes
WebKit Commit Bot
Comment 6
2014-03-26 16:27:15 PDT
Comment on
attachment 227889
[details]
Requested changes Clearing flags on attachment: 227889 Committed
r166325
: <
http://trac.webkit.org/changeset/166325
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug