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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 std::move(service_request)); | 432 std::move(service_request)); |
433 browser_context->SetUserData(kMojoShellConnection, connection_holder); | 433 browser_context->SetUserData(kMojoShellConnection, connection_holder); |
434 | 434 |
435 MojoShellConnection* connection = connection_holder->shell_connection(); | 435 MojoShellConnection* connection = connection_holder->shell_connection(); |
436 | 436 |
437 // New embedded service factories should be added to |connection| here. | 437 // New embedded service factories should be added to |connection| here. |
438 | 438 |
439 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 439 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
440 switches::kMojoLocalStorage)) { | 440 switches::kMojoLocalStorage)) { |
441 MojoApplicationInfo info; | 441 MojoApplicationInfo info; |
442 info.application_factory = base::Bind( | 442 info.application_factory = |
443 &user_service::CreateUserService, | 443 base::Bind(&user_service::CreateUserService, |
444 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 444 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
445 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB)); | 445 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); |
446 connection->AddEmbeddedService(user_service::kUserServiceName, info); | 446 connection->AddEmbeddedService(user_service::kUserServiceName, info); |
447 } | 447 } |
448 } | 448 } |
449 } | 449 } |
450 | 450 |
451 // static | 451 // static |
452 const std::string& BrowserContext::GetShellUserIdFor( | 452 const std::string& BrowserContext::GetShellUserIdFor( |
453 BrowserContext* browser_context) { | 453 BrowserContext* browser_context) { |
454 CHECK(browser_context->GetUserData(kMojoWasInitialized)) | 454 CHECK(browser_context->GetUserData(kMojoWasInitialized)) |
455 << "Attempting to get the mojo user id for a BrowserContext that was " | 455 << "Attempting to get the mojo user id for a BrowserContext that was " |
(...skipping 27 matching lines...) Expand all Loading... |
483 << "Attempting to destroy a BrowserContext that never called " | 483 << "Attempting to destroy a BrowserContext that never called " |
484 << "Initialize()"; | 484 << "Initialize()"; |
485 | 485 |
486 RemoveBrowserContextFromUserIdMap(this); | 486 RemoveBrowserContextFromUserIdMap(this); |
487 | 487 |
488 if (GetUserData(kDownloadManagerKeyName)) | 488 if (GetUserData(kDownloadManagerKeyName)) |
489 GetDownloadManager(this)->Shutdown(); | 489 GetDownloadManager(this)->Shutdown(); |
490 } | 490 } |
491 | 491 |
492 } // namespace content | 492 } // namespace content |
OLD | NEW |