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

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

Issue 1909773002: Convert //extensions/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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/computed_hashes.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 23 matching lines...) Expand all
34 34
35 BlobHolder* new_instance = new BlobHolder(render_process_host); 35 BlobHolder* new_instance = new BlobHolder(render_process_host);
36 render_process_host->SetUserData(&kBlobHolderUserDataKey, new_instance); 36 render_process_host->SetUserData(&kBlobHolderUserDataKey, new_instance);
37 return new_instance; 37 return new_instance;
38 } 38 }
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(scoped_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, make_linked_ptr(blob.release())));
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);
(...skipping 23 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/computed_hashes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698