| OLD | NEW | 
|---|
| 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 #include <algorithm> | 9 #include <algorithm> | 
| 10 #include <limits> | 10 #include <limits> | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 47 #include "services/service_manager/public/interfaces/service.mojom.h" | 47 #include "services/service_manager/public/interfaces/service.mojom.h" | 
| 48 #include "storage/browser/database/database_tracker.h" | 48 #include "storage/browser/database/database_tracker.h" | 
| 49 #include "storage/browser/fileapi/external_mount_points.h" | 49 #include "storage/browser/fileapi/external_mount_points.h" | 
| 50 | 50 | 
| 51 using base::UserDataAdapter; | 51 using base::UserDataAdapter; | 
| 52 | 52 | 
| 53 namespace content { | 53 namespace content { | 
| 54 | 54 | 
| 55 namespace { | 55 namespace { | 
| 56 | 56 | 
| 57 base::LazyInstance<std::map<std::string, BrowserContext*>> | 57 base::LazyInstance<std::map<std::string, BrowserContext*>>::DestructorAtExit | 
| 58     g_user_id_to_context = LAZY_INSTANCE_INITIALIZER; | 58     g_user_id_to_context = LAZY_INSTANCE_INITIALIZER; | 
| 59 | 59 | 
| 60 class ServiceUserIdHolder : public base::SupportsUserData::Data { | 60 class ServiceUserIdHolder : public base::SupportsUserData::Data { | 
| 61  public: | 61  public: | 
| 62   explicit ServiceUserIdHolder(const std::string& user_id) | 62   explicit ServiceUserIdHolder(const std::string& user_id) | 
| 63       : user_id_(user_id) {} | 63       : user_id_(user_id) {} | 
| 64   ~ServiceUserIdHolder() override {} | 64   ~ServiceUserIdHolder() override {} | 
| 65 | 65 | 
| 66   const std::string& user_id() const { return user_id_; } | 66   const std::string& user_id() const { return user_id_; } | 
| 67 | 67 | 
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 516   if (GetUserData(kDownloadManagerKeyName)) | 516   if (GetUserData(kDownloadManagerKeyName)) | 
| 517     GetDownloadManager(this)->Shutdown(); | 517     GetDownloadManager(this)->Shutdown(); | 
| 518 } | 518 } | 
| 519 | 519 | 
| 520 void BrowserContext::ShutdownStoragePartitions() { | 520 void BrowserContext::ShutdownStoragePartitions() { | 
| 521   if (GetUserData(kStoragePartitionMapKeyName)) | 521   if (GetUserData(kStoragePartitionMapKeyName)) | 
| 522     RemoveUserData(kStoragePartitionMapKeyName); | 522     RemoveUserData(kStoragePartitionMapKeyName); | 
| 523 } | 523 } | 
| 524 | 524 | 
| 525 }  // namespace content | 525 }  // namespace content | 
| OLD | NEW | 
|---|