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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 ServiceManagerConnection::GetForProcess(); | 433 ServiceManagerConnection::GetForProcess(); |
434 if (service_manager_connection && base::ThreadTaskRunnerHandle::IsSet()) { | 434 if (service_manager_connection && base::ThreadTaskRunnerHandle::IsSet()) { |
435 // NOTE: Many unit tests create a TestBrowserContext without initializing | 435 // NOTE: Many unit tests create a TestBrowserContext without initializing |
436 // Mojo or the global service manager connection. | 436 // Mojo or the global service manager connection. |
437 | 437 |
438 service_manager::mojom::ServicePtr service; | 438 service_manager::mojom::ServicePtr service; |
439 service_manager::mojom::ServiceRequest service_request(&service); | 439 service_manager::mojom::ServiceRequest service_request(&service); |
440 | 440 |
441 service_manager::mojom::PIDReceiverPtr pid_receiver; | 441 service_manager::mojom::PIDReceiverPtr pid_receiver; |
442 service_manager::Identity identity(mojom::kBrowserServiceName, new_id); | 442 service_manager::Identity identity(mojom::kBrowserServiceName, new_id); |
443 service_manager_connection->GetConnector()->Start( | 443 service_manager_connection->GetConnector()->StartService( |
444 identity, std::move(service), mojo::MakeRequest(&pid_receiver)); | 444 identity, std::move(service), mojo::MakeRequest(&pid_receiver)); |
445 pid_receiver->SetPID(base::GetCurrentProcId()); | 445 pid_receiver->SetPID(base::GetCurrentProcId()); |
446 | 446 |
447 BrowserContextServiceManagerConnectionHolder* connection_holder = | 447 BrowserContextServiceManagerConnectionHolder* connection_holder = |
448 new BrowserContextServiceManagerConnectionHolder( | 448 new BrowserContextServiceManagerConnectionHolder( |
449 service_manager_connection->GetConnector()->Connect(identity), | 449 service_manager_connection->GetConnector()->Connect(identity), |
450 std::move(service_request)); | 450 std::move(service_request)); |
451 browser_context->SetUserData(kServiceManagerConnection, connection_holder); | 451 browser_context->SetUserData(kServiceManagerConnection, connection_holder); |
452 | 452 |
453 ServiceManagerConnection* connection = | 453 ServiceManagerConnection* connection = |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 if (GetUserData(kDownloadManagerKeyName)) | 525 if (GetUserData(kDownloadManagerKeyName)) |
526 GetDownloadManager(this)->Shutdown(); | 526 GetDownloadManager(this)->Shutdown(); |
527 } | 527 } |
528 | 528 |
529 void BrowserContext::ShutdownStoragePartitions() { | 529 void BrowserContext::ShutdownStoragePartitions() { |
530 if (GetUserData(kStoragePartitionMapKeyName)) | 530 if (GetUserData(kStoragePartitionMapKeyName)) |
531 RemoveUserData(kStoragePartitionMapKeyName); | 531 RemoveUserData(kStoragePartitionMapKeyName); |
532 } | 532 } |
533 | 533 |
534 } // namespace content | 534 } // namespace content |
OLD | NEW |