summaryrefslogtreecommitdiff
path: root/chromium/content/common/mojo/current_thread_loader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/common/mojo/current_thread_loader.cc')
-rw-r--r--chromium/content/common/mojo/current_thread_loader.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/chromium/content/common/mojo/current_thread_loader.cc b/chromium/content/common/mojo/current_thread_loader.cc
new file mode 100644
index 00000000000..eb64b150863
--- /dev/null
+++ b/chromium/content/common/mojo/current_thread_loader.cc
@@ -0,0 +1,25 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/mojo/current_thread_loader.h"
+
+namespace content {
+
+CurrentThreadLoader::CurrentThreadLoader(const ApplicationFactory& factory)
+ : factory_(factory) {}
+
+CurrentThreadLoader::~CurrentThreadLoader() {}
+
+void CurrentThreadLoader::Load(const std::string& name,
+ mojo::shell::mojom::ShellClientRequest request) {
+ if (!shell_client_) {
+ shell_client_ = factory_.Run();
+ factory_ = ApplicationFactory();
+ }
+
+ connections_.push_back(make_scoped_ptr(
+ new mojo::ShellConnection(shell_client_.get(), std::move(request))));
+}
+
+} // namespace content