| 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 21 matching lines...) Expand all Loading... |
| 32 #include "content/public/browser/render_process_host.h" | 32 #include "content/public/browser/render_process_host.h" |
| 33 #include "content/public/browser/site_instance.h" | 33 #include "content/public/browser/site_instance.h" |
| 34 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
| 35 #include "content/public/common/service_manager_connection.h" | 35 #include "content/public/common/service_manager_connection.h" |
| 36 #include "content/public/common/service_names.mojom.h" | 36 #include "content/public/common/service_names.mojom.h" |
| 37 #include "net/cookies/cookie_store.h" | 37 #include "net/cookies/cookie_store.h" |
| 38 #include "net/ssl/channel_id_service.h" | 38 #include "net/ssl/channel_id_service.h" |
| 39 #include "net/ssl/channel_id_store.h" | 39 #include "net/ssl/channel_id_store.h" |
| 40 #include "net/url_request/url_request_context.h" | 40 #include "net/url_request/url_request_context.h" |
| 41 #include "net/url_request/url_request_context_getter.h" | 41 #include "net/url_request/url_request_context_getter.h" |
| 42 #include "services/device/device_service.h" | |
| 43 #include "services/device/public/interfaces/constants.mojom.h" | |
| 44 #include "services/file/file_service.h" | 42 #include "services/file/file_service.h" |
| 45 #include "services/file/public/interfaces/constants.mojom.h" | 43 #include "services/file/public/interfaces/constants.mojom.h" |
| 46 #include "services/file/user_id_map.h" | 44 #include "services/file/user_id_map.h" |
| 47 #include "services/service_manager/public/cpp/connection.h" | 45 #include "services/service_manager/public/cpp/connection.h" |
| 48 #include "services/service_manager/public/cpp/connector.h" | 46 #include "services/service_manager/public/cpp/connector.h" |
| 49 #include "services/service_manager/public/interfaces/service.mojom.h" | 47 #include "services/service_manager/public/interfaces/service.mojom.h" |
| 50 #include "storage/browser/database/database_tracker.h" | 48 #include "storage/browser/database/database_tracker.h" |
| 51 #include "storage/browser/fileapi/external_mount_points.h" | 49 #include "storage/browser/fileapi/external_mount_points.h" |
| 52 | 50 |
| 53 using base::UserDataAdapter; | 51 using base::UserDataAdapter; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 new BrowserContextServiceManagerConnectionHolder( | 446 new BrowserContextServiceManagerConnectionHolder( |
| 449 service_manager_connection->GetConnector()->Connect(identity), | 447 service_manager_connection->GetConnector()->Connect(identity), |
| 450 std::move(service_request)); | 448 std::move(service_request)); |
| 451 browser_context->SetUserData(kServiceManagerConnection, connection_holder); | 449 browser_context->SetUserData(kServiceManagerConnection, connection_holder); |
| 452 | 450 |
| 453 ServiceManagerConnection* connection = | 451 ServiceManagerConnection* connection = |
| 454 connection_holder->service_manager_connection(); | 452 connection_holder->service_manager_connection(); |
| 455 connection->Start(); | 453 connection->Start(); |
| 456 | 454 |
| 457 // New embedded service factories should be added to |connection| here. | 455 // New embedded service factories should be added to |connection| here. |
| 458 // TODO(blundell): Does this belong as a global service rather than per | |
| 459 // BrowserContext? | |
| 460 ServiceInfo info; | |
| 461 info.factory = | |
| 462 base::Bind(&device::CreateDeviceService, | |
| 463 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); | |
| 464 connection->AddEmbeddedService(device::mojom::kServiceName, info); | |
| 465 | 456 |
| 466 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 457 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 467 switches::kMojoLocalStorage)) { | 458 switches::kMojoLocalStorage)) { |
| 468 ServiceInfo info; | 459 ServiceInfo info; |
| 469 info.factory = | 460 info.factory = |
| 470 base::Bind(&file::CreateFileService, | 461 base::Bind(&file::CreateFileService, |
| 471 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 462 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 472 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); | 463 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); |
| 473 connection->AddEmbeddedService(file::mojom::kServiceName, info); | 464 connection->AddEmbeddedService(file::mojom::kServiceName, info); |
| 474 } | 465 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 if (GetUserData(kDownloadManagerKeyName)) | 516 if (GetUserData(kDownloadManagerKeyName)) |
| 526 GetDownloadManager(this)->Shutdown(); | 517 GetDownloadManager(this)->Shutdown(); |
| 527 } | 518 } |
| 528 | 519 |
| 529 void BrowserContext::ShutdownStoragePartitions() { | 520 void BrowserContext::ShutdownStoragePartitions() { |
| 530 if (GetUserData(kStoragePartitionMapKeyName)) | 521 if (GetUserData(kStoragePartitionMapKeyName)) |
| 531 RemoveUserData(kStoragePartitionMapKeyName); | 522 RemoveUserData(kStoragePartitionMapKeyName); |
| 532 } | 523 } |
| 533 | 524 |
| 534 } // namespace content | 525 } // namespace content |
| OLD | NEW |