OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/service_manager/service_manager_context.h" | 5 #include "content/browser/service_manager/service_manager_context.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 unsandboxed_services.insert( | 366 unsandboxed_services.insert( |
367 std::make_pair(content::mojom::kNetworkServiceName, | 367 std::make_pair(content::mojom::kNetworkServiceName, |
368 base::ASCIIToUTF16("Network Service"))); | 368 base::ASCIIToUTF16("Network Service"))); |
369 } | 369 } |
370 if (base::FeatureList::IsEnabled(video_capture::kMojoVideoCapture)) { | 370 if (base::FeatureList::IsEnabled(video_capture::kMojoVideoCapture)) { |
371 unsandboxed_services.insert( | 371 unsandboxed_services.insert( |
372 std::make_pair(video_capture::mojom::kServiceName, | 372 std::make_pair(video_capture::mojom::kServiceName, |
373 base::ASCIIToUTF16("Video Capture Service"))); | 373 base::ASCIIToUTF16("Video Capture Service"))); |
374 } | 374 } |
375 | 375 |
376 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) | |
377 // TODO(xhwang): This is only used for test/experiment for now so it's okay | |
378 // to run it in an unsandboxed utility process. Fix CDM loading so that we can | |
379 // run it in the sandboxed utility process. See http://crbug.com/510604 | |
380 // TODO(xhwang): Replace the service name "media" with a constant string. | |
381 unsandboxed_services.insert( | |
382 std::make_pair("media", base::ASCIIToUTF16("Media Service"))); | |
383 #endif | |
384 | |
385 for (const auto& service : unsandboxed_services) { | 376 for (const auto& service : unsandboxed_services) { |
386 packaged_services_connection_->AddServiceRequestHandler( | 377 packaged_services_connection_->AddServiceRequestHandler( |
387 service.first, base::Bind(&StartServiceInUtilityProcess, service.first, | 378 service.first, base::Bind(&StartServiceInUtilityProcess, service.first, |
388 service.second, false /* use_sandbox */)); | 379 service.second, false /* use_sandbox */)); |
389 } | 380 } |
390 | 381 |
391 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 382 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
392 packaged_services_connection_->AddServiceRequestHandler( | 383 packaged_services_connection_->AddServiceRequestHandler( |
393 "media", base::Bind(&StartServiceInGpuProcess, "media")); | 384 "media", base::Bind(&StartServiceInGpuProcess, "media")); |
394 #endif | 385 #endif |
(...skipping 29 matching lines...) Expand all Loading... |
424 base::Bind(&DestroyConnectorOnIOThread)); | 415 base::Bind(&DestroyConnectorOnIOThread)); |
425 } | 416 } |
426 | 417 |
427 // static | 418 // static |
428 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { | 419 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { |
429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 420 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
430 return g_io_thread_connector.Get().get(); | 421 return g_io_thread_connector.Get().get(); |
431 } | 422 } |
432 | 423 |
433 } // namespace content | 424 } // namespace content |
OLD | NEW |