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

Side by Side Diff: content/child/process_control_impl.cc

Issue 1978843003: Move in-GPU mojo:media app to new thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
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/child/process_control_impl.h" 5 #include "content/child/process_control_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 12 matching lines...) Expand all
23 const mojo::String& name, 23 const mojo::String& name,
24 shell::mojom::ShellClientRequest request, 24 shell::mojom::ShellClientRequest request,
25 const LoadApplicationCallback& callback) { 25 const LoadApplicationCallback& callback) {
26 // Only register apps on first run. 26 // Only register apps on first run.
27 if (!has_registered_apps_) { 27 if (!has_registered_apps_) {
28 DCHECK(apps_.empty()); 28 DCHECK(apps_.empty());
29 ApplicationMap apps; 29 ApplicationMap apps;
30 RegisterApplications(&apps); 30 RegisterApplications(&apps);
31 for (const auto& app : apps) { 31 for (const auto& app : apps) {
32 std::unique_ptr<EmbeddedApplicationRunner> runner( 32 std::unique_ptr<EmbeddedApplicationRunner> runner(
33 new EmbeddedApplicationRunner(app.second.application_factory, 33 new EmbeddedApplicationRunner(app.first, app.second));
34 app.second.application_task_runner));
35 runner->SetQuitClosure(base::Bind(&ProcessControlImpl::OnApplicationQuit, 34 runner->SetQuitClosure(base::Bind(&ProcessControlImpl::OnApplicationQuit,
36 base::Unretained(this))); 35 base::Unretained(this)));
37 apps_.insert(std::make_pair(app.first, std::move(runner))); 36 apps_.insert(std::make_pair(app.first, std::move(runner)));
38 } 37 }
39 has_registered_apps_ = true; 38 has_registered_apps_ = true;
40 } 39 }
41 40
42 auto it = apps_.find(name); 41 auto it = apps_.find(name);
43 if (it == apps_.end()) { 42 if (it == apps_.end()) {
44 callback.Run(false); 43 callback.Run(false);
45 OnLoadFailed(); 44 OnLoadFailed();
46 return; 45 return;
47 } 46 }
48 47
49 callback.Run(true); 48 callback.Run(true);
50 it->second->BindShellClientRequest(std::move(request)); 49 it->second->BindShellClientRequest(std::move(request));
51 } 50 }
52 51
53 } // namespace content 52 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mojo/mojo_shell_context.cc ('k') | content/common/mojo/embedded_application_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698