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

Side by Side Diff: content/browser/browser_context.cc

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/browser/browser_context.h" 5 #include "content/public/browser/browser_context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // unittests where a UI thread might not have been created. 219 // unittests where a UI thread might not have been created.
220 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || 220 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
221 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); 221 !BrowserThread::IsMessageLoopValid(BrowserThread::UI));
222 222
223 #if defined(OS_CHROMEOS) 223 #if defined(OS_CHROMEOS)
224 if (!context->GetUserData(kMountPointsKey)) { 224 if (!context->GetUserData(kMountPointsKey)) {
225 scoped_refptr<storage::ExternalMountPoints> mount_points = 225 scoped_refptr<storage::ExternalMountPoints> mount_points =
226 storage::ExternalMountPoints::CreateRefCounted(); 226 storage::ExternalMountPoints::CreateRefCounted();
227 context->SetUserData( 227 context->SetUserData(
228 kMountPointsKey, 228 kMountPointsKey,
229 new UserDataAdapter<storage::ExternalMountPoints>(mount_points.get())); 229 base::MakeUnique<UserDataAdapter<storage::ExternalMountPoints>>(
230 mount_points.get()));
230 } 231 }
231 232
232 return UserDataAdapter<storage::ExternalMountPoints>::Get(context, 233 return UserDataAdapter<storage::ExternalMountPoints>::Get(context,
233 kMountPointsKey); 234 kMountPointsKey);
234 #else 235 #else
235 return NULL; 236 return NULL;
236 #endif 237 #endif
237 } 238 }
238 239
239 // static 240 // static
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 base::Base64Encode(base::RandBytesAsString(16), &salt); 565 base::Base64Encode(base::RandBytesAsString(16), &salt);
565 DCHECK(!salt.empty()); 566 DCHECK(!salt.empty());
566 return salt; 567 return salt;
567 } 568 }
568 569
569 BrowsingDataRemoverDelegate* BrowserContext::GetBrowsingDataRemoverDelegate() { 570 BrowsingDataRemoverDelegate* BrowserContext::GetBrowsingDataRemoverDelegate() {
570 return nullptr; 571 return nullptr;
571 } 572 }
572 573
573 } // namespace content 574 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/blob_storage/chrome_blob_storage_context.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698