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

Unified Diff: content/browser/streams/stream_context.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/streams/stream_context.cc
diff --git a/content/browser/streams/stream_context.cc b/content/browser/streams/stream_context.cc
index 3782205cebd2887116ca9caf8d581714f1780869..22e3c0620c7493857e32ee798c599f7a1a9a54c4 100644
--- a/content/browser/streams/stream_context.cc
+++ b/content/browser/streams/stream_context.cc
@@ -5,6 +5,7 @@
#include "content/browser/streams/stream_context.h"
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "content/browser/streams/stream_registry.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
@@ -24,8 +25,9 @@ StreamContext::StreamContext() {}
StreamContext* StreamContext::GetFor(BrowserContext* context) {
if (!context->GetUserData(kStreamContextKeyName)) {
scoped_refptr<StreamContext> stream = new StreamContext();
- context->SetUserData(kStreamContextKeyName,
- new UserDataAdapter<StreamContext>(stream.get()));
+ context->SetUserData(
+ kStreamContextKeyName,
+ base::MakeUnique<UserDataAdapter<StreamContext>>(stream.get()));
// Check first to avoid memory leak in unittests.
if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
BrowserThread::PostTask(
« no previous file with comments | « content/browser/ssl/ssl_manager.cc ('k') | content/browser/websockets/websocket_handshake_request_info_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698