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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 user_service::AssociateShellUserIdWithUserDir(new_id, path); | 405 user_service::AssociateShellUserIdWithUserDir(new_id, path); |
406 RemoveBrowserContextFromUserIdMap(browser_context); | 406 RemoveBrowserContextFromUserIdMap(browser_context); |
407 g_user_id_to_context.Get()[new_id] = browser_context; | 407 g_user_id_to_context.Get()[new_id] = browser_context; |
408 browser_context->SetUserData(kMojoShellUserId, | 408 browser_context->SetUserData(kMojoShellUserId, |
409 new ShellUserIdHolder(new_id)); | 409 new ShellUserIdHolder(new_id)); |
410 | 410 |
411 browser_context->SetUserData(kMojoWasInitialized, | 411 browser_context->SetUserData(kMojoWasInitialized, |
412 new base::SupportsUserData::Data); | 412 new base::SupportsUserData::Data); |
413 | 413 |
414 MojoShellConnection* shell = MojoShellConnection::GetForProcess(); | 414 MojoShellConnection* shell = MojoShellConnection::GetForProcess(); |
415 if (shell && base::ThreadTaskRunnerHandle::Get()) { | 415 if (shell && base::ThreadTaskRunnerHandle::IsSet()) { |
416 // NOTE: Many unit tests create a TestBrowserContext without initializing | 416 // NOTE: Many unit tests create a TestBrowserContext without initializing |
417 // Mojo or the global Mojo shell connection. | 417 // Mojo or the global Mojo shell connection. |
418 | 418 |
419 shell::mojom::ShellClientPtr shell_client; | 419 shell::mojom::ShellClientPtr shell_client; |
420 shell::mojom::ShellClientRequest shell_client_request = | 420 shell::mojom::ShellClientRequest shell_client_request = |
421 mojo::GetProxy(&shell_client); | 421 mojo::GetProxy(&shell_client); |
422 | 422 |
423 shell::mojom::PIDReceiverPtr pid_receiver; | 423 shell::mojom::PIDReceiverPtr pid_receiver; |
424 shell::Connector::ConnectParams params( | 424 shell::Connector::ConnectParams params( |
425 shell::Identity(kBrowserMojoApplicationName, new_id)); | 425 shell::Identity(kBrowserMojoApplicationName, new_id)); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 << "Attempting to destroy a BrowserContext that never called " | 484 << "Attempting to destroy a BrowserContext that never called " |
485 << "Initialize()"; | 485 << "Initialize()"; |
486 | 486 |
487 RemoveBrowserContextFromUserIdMap(this); | 487 RemoveBrowserContextFromUserIdMap(this); |
488 | 488 |
489 if (GetUserData(kDownloadManagerKeyName)) | 489 if (GetUserData(kDownloadManagerKeyName)) |
490 GetDownloadManager(this)->Shutdown(); | 490 GetDownloadManager(this)->Shutdown(); |
491 } | 491 } |
492 | 492 |
493 } // namespace content | 493 } // namespace content |
OLD | NEW |