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

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

Issue 10919137: SupportsUserData is not thread safe (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed indexeddb test Created 8 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
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/browser/resource_context_impl.h" 5 #include "content/browser/resource_context_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/appcache/chrome_appcache_service.h" 8 #include "content/browser/appcache/chrome_appcache_service.h"
9 #include "content/browser/fileapi/browser_file_system_helper.h" 9 #include "content/browser/fileapi/browser_file_system_helper.h"
10 #include "content/browser/fileapi/chrome_blob_storage_context.h" 10 #include "content/browser/fileapi/chrome_blob_storage_context.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 kBlobStorageContextKeyName, 275 kBlobStorageContextKeyName,
276 new UserDataAdapter<ChromeBlobStorageContext>( 276 new UserDataAdapter<ChromeBlobStorageContext>(
277 ChromeBlobStorageContext::GetFor(browser_context))); 277 ChromeBlobStorageContext::GetFor(browser_context)));
278 278
279 // This object is owned by the BrowserContext and not ResourceContext, so 279 // This object is owned by the BrowserContext and not ResourceContext, so
280 // store a non-owning pointer here. 280 // store a non-owning pointer here.
281 resource_context->SetUserData( 281 resource_context->SetUserData(
282 kHostZoomMapKeyName, 282 kHostZoomMapKeyName,
283 new NonOwningZoomData( 283 new NonOwningZoomData(
284 HostZoomMap::GetForBrowserContext(browser_context))); 284 HostZoomMap::GetForBrowserContext(browser_context)));
285 resource_context->DetachUserDataThread();
285 286
286 // Add content's URLRequestContext's hooks. 287 // Add content's URLRequestContext's hooks.
287 // Check first to avoid memory leak in unittests. 288 // Check first to avoid memory leak in unittests.
288 // TODO(creis): Do equivalent initializations for isolated app and isolated 289 // TODO(creis): Do equivalent initializations for isolated app and isolated
289 // media request contexts. 290 // media request contexts.
290 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { 291 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
291 // TODO(ajwong): Move this whole block into 292 // TODO(ajwong): Move this whole block into
292 // StoragePartitionImplMap::PostCreateInitialization after we're certain 293 // StoragePartitionImplMap::PostCreateInitialization after we're certain
293 // this is safe to happen before InitializeResourceContext, and after we've 294 // this is safe to happen before InitializeResourceContext, and after we've
294 // found the right URLRequestContext for a storage partition. Otherwise, 295 // found the right URLRequestContext for a storage partition. Otherwise,
(...skipping 19 matching lines...) Expand all
314 make_scoped_refptr(browser_context->GetMediaRequestContext()), 315 make_scoped_refptr(browser_context->GetMediaRequestContext()),
315 BrowserContext::GetAppCacheService(browser_context), 316 BrowserContext::GetAppCacheService(browser_context),
316 make_scoped_refptr( 317 make_scoped_refptr(
317 BrowserContext::GetFileSystemContext(browser_context)), 318 BrowserContext::GetFileSystemContext(browser_context)),
318 make_scoped_refptr( 319 make_scoped_refptr(
319 ChromeBlobStorageContext::GetFor(browser_context)))); 320 ChromeBlobStorageContext::GetFor(browser_context))));
320 } 321 }
321 } 322 }
322 323
323 } // namespace content 324 } // namespace content
OLDNEW
« base/supports_user_data.cc ('K') | « content/browser/in_process_webkit/indexed_db_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698