| 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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 | 455 |
| 456 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 456 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 457 switches::kMojoLocalStorage)) { | 457 switches::kMojoLocalStorage)) { |
| 458 ServiceInfo info; | 458 ServiceInfo info; |
| 459 info.factory = | 459 info.factory = |
| 460 base::Bind(&file::CreateFileService, | 460 base::Bind(&file::CreateFileService, |
| 461 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 461 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 462 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); | 462 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); |
| 463 connection->AddEmbeddedService(file::mojom::kServiceName, info); | 463 connection->AddEmbeddedService(file::mojom::kServiceName, info); |
| 464 } | 464 } |
| 465 |
| 466 ContentBrowserClient::StaticServiceMap services; |
| 467 browser_context->RegisterInProcessServices(&services); |
| 468 for (const auto& entry : services) { |
| 469 connection->AddEmbeddedService(entry.first, entry.second); |
| 470 } |
| 465 connection->Start(); | 471 connection->Start(); |
| 466 } | 472 } |
| 467 } | 473 } |
| 468 | 474 |
| 469 // static | 475 // static |
| 470 const std::string& BrowserContext::GetServiceUserIdFor( | 476 const std::string& BrowserContext::GetServiceUserIdFor( |
| 471 BrowserContext* browser_context) { | 477 BrowserContext* browser_context) { |
| 472 CHECK(browser_context->GetUserData(kMojoWasInitialized)) | 478 CHECK(browser_context->GetUserData(kMojoWasInitialized)) |
| 473 << "Attempting to get the mojo user id for a BrowserContext that was " | 479 << "Attempting to get the mojo user id for a BrowserContext that was " |
| 474 << "never Initialize()ed."; | 480 << "never Initialize()ed."; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 if (GetUserData(kDownloadManagerKeyName)) | 522 if (GetUserData(kDownloadManagerKeyName)) |
| 517 GetDownloadManager(this)->Shutdown(); | 523 GetDownloadManager(this)->Shutdown(); |
| 518 } | 524 } |
| 519 | 525 |
| 520 void BrowserContext::ShutdownStoragePartitions() { | 526 void BrowserContext::ShutdownStoragePartitions() { |
| 521 if (GetUserData(kStoragePartitionMapKeyName)) | 527 if (GetUserData(kStoragePartitionMapKeyName)) |
| 522 RemoveUserData(kStoragePartitionMapKeyName); | 528 RemoveUserData(kStoragePartitionMapKeyName); |
| 523 } | 529 } |
| 524 | 530 |
| 525 } // namespace content | 531 } // namespace content |
| OLD | NEW |