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