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

Side by Side Diff: extensions/browser/blob_holder.cc

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: address comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/blob_holder.h ('k') | extensions/browser/content_verifier_io_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/blob_holder.h" 5 #include "extensions/browser/blob_holder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 28 matching lines...) Expand all
39 39
40 BlobHolder::~BlobHolder() { 40 BlobHolder::~BlobHolder() {
41 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 41 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
42 } 42 }
43 43
44 void BlobHolder::HoldBlobReference(std::unique_ptr<content::BlobHandle> blob) { 44 void BlobHolder::HoldBlobReference(std::unique_ptr<content::BlobHandle> blob) {
45 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 45 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
46 DCHECK(!ContainsBlobHandle(blob.get())); 46 DCHECK(!ContainsBlobHandle(blob.get()));
47 47
48 std::string uuid = blob->GetUUID(); 48 std::string uuid = blob->GetUUID();
49 held_blobs_.insert(make_pair(uuid, make_linked_ptr(blob.release()))); 49 held_blobs_.insert(make_pair(uuid, std::move(blob)));
50 } 50 }
51 51
52 BlobHolder::BlobHolder(content::RenderProcessHost* render_process_host) 52 BlobHolder::BlobHolder(content::RenderProcessHost* render_process_host)
53 : render_process_host_(render_process_host) { 53 : render_process_host_(render_process_host) {
54 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 54 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
55 } 55 }
56 56
57 bool BlobHolder::ContainsBlobHandle(content::BlobHandle* handle) const { 57 bool BlobHolder::ContainsBlobHandle(content::BlobHandle* handle) const {
58 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 58 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
59 for (BlobHandleMultimap::const_iterator it = held_blobs_.begin(); 59 for (BlobHandleMultimap::const_iterator it = held_blobs_.begin();
(...skipping 18 matching lines...) Expand all
78 } else { 78 } else {
79 DLOG(ERROR) << "Tried to release a Blob we don't have ownership to." 79 DLOG(ERROR) << "Tried to release a Blob we don't have ownership to."
80 << "UUID: " << *uuid_it; 80 << "UUID: " << *uuid_it;
81 bad_message::ReceivedBadMessage(render_process_host_, 81 bad_message::ReceivedBadMessage(render_process_host_,
82 bad_message::BH_BLOB_NOT_OWNED); 82 bad_message::BH_BLOB_NOT_OWNED);
83 } 83 }
84 } 84 }
85 } 85 }
86 86
87 } // namespace extensions 87 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/blob_holder.h ('k') | extensions/browser/content_verifier_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698