Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Issue 1241973002: Use std::string references instead of copying contents. (Closed)

Created:
5 years, 5 months ago by joachim
Modified:
5 years, 5 months ago
Reviewers:
tommi, pthatcher1
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, qiang.lu, niklas.enbom, yujie_mao (webrtc), Andrew MacDonald
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Use std::string references instead of copying contents. This CL improves the memory footprint a bit by using string references instead of creating a copy. Committed: https://crrev.com/083b73fb95755b78cb0b9cbe67752b7e7b7eb263 Cr-Commit-Position: refs/heads/master@{#9592}

Patch Set 1 #

Patch Set 2 : Changed another occurrence. #

Total comments: 2

Patch Set 3 : Fix use-after-free #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -18 lines) Patch
M talk/app/webrtc/jsepsessiondescription.cc View 1 chunk +1 line, -1 line 0 comments Download
M talk/app/webrtc/webrtcsdp.cc View 8 chunks +12 lines, -12 lines 0 comments Download
M talk/media/webrtc/webrtcvideocapturer.cc View 1 chunk +1 line, -1 line 0 comments Download
M talk/media/webrtc/webrtcvideoengine2.cc View 1 chunk +1 line, -1 line 0 comments Download
M talk/session/media/mediasession.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
joachim
ptal
5 years, 5 months ago (2015-07-15 23:14:50 UTC) #2
pthatcher1
lgtm
5 years, 5 months ago (2015-07-16 04:38:08 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1241973002/20001
5 years, 5 months ago (2015-07-16 06:28:31 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: win_x64_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/win_x64_rel/builds/8412) (exceeded global retry quota)
5 years, 5 months ago (2015-07-16 06:48:30 UTC) #7
joachim
Changed the CL https://codereview.webrtc.org/1241973002/diff/20001/talk/app/webrtc/webrtcsession.cc File talk/app/webrtc/webrtcsession.cc (right): https://codereview.webrtc.org/1241973002/diff/20001/talk/app/webrtc/webrtcsession.cc#newcode1584 talk/app/webrtc/webrtcsession.cc:1584: const std::string& content_name = video_channel_->content_name(); This ...
5 years, 5 months ago (2015-07-16 08:21:47 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1241973002/40001
5 years, 5 months ago (2015-07-16 08:22:33 UTC) #10
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 5 months ago (2015-07-16 09:06:00 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1241973002/40001
5 years, 5 months ago (2015-07-16 09:45:23 UTC) #15
pthatcher1
Yeah, that one is tricky. Good thing it was caught by the tests. Perhaps we ...
5 years, 5 months ago (2015-07-16 09:45:48 UTC) #16
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 5 months ago (2015-07-16 09:46:38 UTC) #17
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/083b73fb95755b78cb0b9cbe67752b7e7b7eb263 Cr-Commit-Position: refs/heads/master@{#9592}
5 years, 5 months ago (2015-07-16 09:46:52 UTC) #18
joachim
5 years, 5 months ago (2015-07-16 10:02:41 UTC) #19
Message was sent while issue was closed.
On 2015/07/16 09:45:48, pthatcher1 wrote:
> Yeah, that one is tricky.  Good thing it was caught by the tests. Perhaps we
> should be more careful about these.  I think I found another one that might be
> dangerous.
> 
>
https://codereview.webrtc.org/1241973002/diff/20001/talk/media/webrtc/webrtcv...
> File talk/media/webrtc/webrtcvideoengine2.cc (right):
> 
>
https://codereview.webrtc.org/1241973002/diff/20001/talk/media/webrtc/webrtcv...
> talk/media/webrtc/webrtcvideoengine2.cc:158:
> webrtc::field_trial::FindFullName("WebRTC-SupportVP9");
> I'm not sure this one is safe, either.  webrtc::field_trial::FindFullName can
> return "std::string()", which I don't think is safe to take a reference to.

Good catch, thanks. I uploaded https://codereview.webrtc.org/1238943003 to
change this back to copy the string.

Powered by Google App Engine
This is Rietveld 408576698