New issue
Advanced search Search tips

Issue 595163 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Feature



Sign in to add a comment

base::RefCountedBytes::TakeVector should return a scoped_refptr.

Project Member Reported by vmp...@chromium.org, Mar 16 2016

Issue description

This class returns a pointer to raw memory, relying on the caller for cleanup. Make this return a scoped_refptr instead.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/219dc045a6270ee0563460417e04a95f48ee71dd

commit 219dc045a6270ee0563460417e04a95f48ee71dd
Author: vmpstr <vmpstr@chromium.org>
Date: Wed Mar 16 19:38:29 2016

base: Make RefCountedBytes::TakeVector return ref ptr instead of raw ptr

This patch changes RefCountedBytes::TakeVector to return a ref ptr
instead of a raw pointer. This minimizes the changes of a leak if a
caller forgets to delete it, or forgets to wrap it in a ref ptr.

R=danakj@chromium.org, thakis@chromium.org
TBR=thakis@chromium.org
BUG= 595163 

Review URL: https://codereview.chromium.org/1803263002

Cr-Commit-Position: refs/heads/master@{#381512}

[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/base/memory/ref_counted_memory.cc
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/base/memory/ref_counted_memory.h
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/history/android/sqlite_cursor_unittest.cc
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/printing/cloud_print/privet_http_unittest.cc
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/printing/print_preview_data_service.cc
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/printing/print_preview_data_service.h
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/printing/print_preview_message_handler.cc
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/themes/browser_theme_pack.cc
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/chrome/browser/ui/webui/print_preview/print_preview_ui.h
[modify] https://crrev.com/219dc045a6270ee0563460417e04a95f48ee71dd/ui/base/x/selection_requestor.cc

Comment 2 by vmp...@chromium.org, Mar 16 2016

Status: Fixed (was: Started)

Sign in to add a comment