| 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 "chrome/browser/importer/external_process_importer_client.h" | 5 #include "chrome/browser/importer/external_process_importer_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 bridge_(bridge), | 38 bridge_(bridge), |
| 39 cancelled_(false), | 39 cancelled_(false), |
| 40 binding_(this) { | 40 binding_(this) { |
| 41 process_importer_host_->NotifyImportStarted(); | 41 process_importer_host_->NotifyImportStarted(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void ExternalProcessImporterClient::Start() { | 44 void ExternalProcessImporterClient::Start() { |
| 45 AddRef(); // balanced in Cleanup. | 45 AddRef(); // balanced in Cleanup. |
| 46 | 46 |
| 47 chrome::mojom::ProfileImportRequest request = | 47 chrome::mojom::ProfileImportRequest request = |
| 48 mojo::GetProxy(&profile_import_); | 48 mojo::MakeRequest(&profile_import_); |
| 49 | 49 |
| 50 BrowserThread::ID thread_id; | 50 BrowserThread::ID thread_id; |
| 51 CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_id)); | 51 CHECK(BrowserThread::GetCurrentThreadIdentifier(&thread_id)); |
| 52 BrowserThread::PostTask( | 52 BrowserThread::PostTask( |
| 53 BrowserThread::IO, FROM_HERE, | 53 BrowserThread::IO, FROM_HERE, |
| 54 base::Bind(&ExternalProcessImporterClient::StartProcessOnIOThread, this, | 54 base::Bind(&ExternalProcessImporterClient::StartProcessOnIOThread, this, |
| 55 thread_id, base::Passed(std::move(request)))); | 55 thread_id, base::Passed(std::move(request)))); |
| 56 | 56 |
| 57 // Dictionary of all localized strings that could be needed by the importer | 57 // Dictionary of all localized strings that could be needed by the importer |
| 58 // in the external process. | 58 // in the external process. |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 utility_process_host_->Start(); | 309 utility_process_host_->Start(); |
| 310 chrome::mojom::ProfileImportPtr profile_import; | 310 chrome::mojom::ProfileImportPtr profile_import; |
| 311 utility_process_host_->GetRemoteInterfaces()->GetInterface( | 311 utility_process_host_->GetRemoteInterfaces()->GetInterface( |
| 312 std::move(request)); | 312 std::move(request)); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void ExternalProcessImporterClient::CloseMojoHandles() { | 315 void ExternalProcessImporterClient::CloseMojoHandles() { |
| 316 profile_import_.reset(); | 316 profile_import_.reset(); |
| 317 binding_.Close(); | 317 binding_.Close(); |
| 318 } | 318 } |
| OLD | NEW |