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

Issue 2629543002: pp::Buffer_Dev: Clear PP_Resource upon Map() error in Init() (Closed)

Created:
3 years, 11 months ago by xhwang
Modified:
3 years, 11 months ago
Reviewers:
bbudge, raymes
CC:
chromium-reviews, yusukes+watch_chromium.org, tzik, binji+watch_chromium.org, teravest+watch_chromium.org, bradnelson+warch_chromium.org, piman+watch_chromium.org, ihf+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

pp::Buffer_Dev: Clear PP_Resource upon Map() error in Init() Now if Map() failed, we clear |data_| and |size_|, but |pp_resource_| is not cleared. Therefore, if the caller calls buffer.is_null() it will return false. Since the Init() failed, buffer.is_null() should return true. In this CL, if Map() failed, we call Clear() to explicitly clear |pp_resource_|. BUG=679801 Review-Url: https://codereview.chromium.org/2629543002 Cr-Commit-Position: refs/heads/master@{#443159} Committed: https://chromium.googlesource.com/chromium/src/+/743436752458c33f45fb41236ebedd29a69c90f3

Patch Set 1 : This is how I test the bug and fix. #

Patch Set 2 : real fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -0 lines) Patch
M ppapi/cpp/dev/buffer_dev.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (4 generated)
xhwang
PS2 is the real fix which is a one-line fix. PS1 shows how I hack ...
3 years, 11 months ago (2017-01-12 00:47:25 UTC) #2
raymes
Hmm, I'm not sure whether clearing the resource is the right thing to do here. ...
3 years, 11 months ago (2017-01-12 01:39:49 UTC) #3
xhwang
On 2017/01/12 01:39:49, raymes wrote: > Hmm, I'm not sure whether clearing the resource is ...
3 years, 11 months ago (2017-01-12 04:32:55 UTC) #4
raymes
Ah, in that case lgtm. Thanks!
3 years, 11 months ago (2017-01-12 04:34:53 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2629543002/20001
3 years, 11 months ago (2017-01-12 04:35:46 UTC) #7
commit-bot: I haz the power
3 years, 11 months ago (2017-01-12 05:22:40 UTC) #10
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/743436752458c33f45fb41236ebe...

Powered by Google App Engine
This is Rietveld 408576698