Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: content/browser/browser_context.cc

Issue 2407353002: Remove MessageLoop::current() from browser_context.cc. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 RemoveBrowserContextFromUserIdMap(browser_context); 424 RemoveBrowserContextFromUserIdMap(browser_context);
425 g_user_id_to_context.Get()[new_id] = browser_context; 425 g_user_id_to_context.Get()[new_id] = browser_context;
426 browser_context->SetUserData(kServiceUserId, 426 browser_context->SetUserData(kServiceUserId,
427 new ServiceUserIdHolder(new_id)); 427 new ServiceUserIdHolder(new_id));
428 428
429 browser_context->SetUserData(kMojoWasInitialized, 429 browser_context->SetUserData(kMojoWasInitialized,
430 new base::SupportsUserData::Data); 430 new base::SupportsUserData::Data);
431 431
432 ServiceManagerConnection* service_manager_connection = 432 ServiceManagerConnection* service_manager_connection =
433 ServiceManagerConnection::GetForProcess(); 433 ServiceManagerConnection::GetForProcess();
434 if (service_manager_connection && base::MessageLoop::current()) { 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 shell::mojom::ServicePtr service; 438 shell::mojom::ServicePtr service;
439 shell::mojom::ServiceRequest service_request = mojo::GetProxy(&service); 439 shell::mojom::ServiceRequest service_request = mojo::GetProxy(&service);
440 440
441 shell::mojom::PIDReceiverPtr pid_receiver; 441 shell::mojom::PIDReceiverPtr pid_receiver;
442 shell::Connector::ConnectParams params( 442 shell::Connector::ConnectParams params(
443 shell::Identity(kBrowserServiceName, new_id)); 443 shell::Identity(kBrowserServiceName, new_id));
444 params.set_client_process_connection(std::move(service), 444 params.set_client_process_connection(std::move(service),
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 if (GetUserData(kDownloadManagerKeyName)) 519 if (GetUserData(kDownloadManagerKeyName))
520 GetDownloadManager(this)->Shutdown(); 520 GetDownloadManager(this)->Shutdown();
521 } 521 }
522 522
523 void BrowserContext::ShutdownStoragePartitions() { 523 void BrowserContext::ShutdownStoragePartitions() {
524 if (GetUserData(kStoragePartitionMapKeyName)) 524 if (GetUserData(kStoragePartitionMapKeyName))
525 RemoveUserData(kStoragePartitionMapKeyName); 525 RemoveUserData(kStoragePartitionMapKeyName);
526 } 526 }
527 527
528 } // namespace content 528 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698