[modular][storycontroller] Remove implementation of StartContainerInShell().
This is deprecated & has a single client (an example app in topaz/).
TEST=none
Change-Id: I700624fe5913ada448aa7c0032b8a7bc91e376fc
diff --git a/bin/sessionmgr/story_runner/module_context_impl.cc b/bin/sessionmgr/story_runner/module_context_impl.cc
index c2fb931..ba5604c 100644
--- a/bin/sessionmgr/story_runner/module_context_impl.cc
+++ b/bin/sessionmgr/story_runner/module_context_impl.cc
@@ -98,15 +98,7 @@
std::vector<fuchsia::modular::ContainerLayout> layout,
std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
std::vector<fuchsia::modular::ContainerNode> nodes) {
- std::vector<fuchsia::modular::ContainerNodePtr> node_ptrs;
- node_ptrs.reserve(nodes.size());
- for (auto& i : nodes) {
- node_ptrs.push_back(fidl::MakeOptional(std::move(i)));
- }
- story_controller_impl_->StartContainerInShell(
- module_data_->module_path, name,
- fidl::MakeOptional(std::move(parent_relation)), std::move(layout),
- std::move(relationships), std::move(node_ptrs));
+ FXL_LOG(ERROR) << "ModuleContext.StartContainerInShell() not implemented.";
}
void ModuleContextImpl::GetComponentContext(
diff --git a/bin/sessionmgr/story_runner/story_controller_impl.cc b/bin/sessionmgr/story_runner/story_controller_impl.cc
index 4a196fc..0cda4a3 100644
--- a/bin/sessionmgr/story_runner/story_controller_impl.cc
+++ b/bin/sessionmgr/story_runner/story_controller_impl.cc
@@ -890,100 +890,6 @@
FXL_DISALLOW_COPY_AND_ASSIGN(AddIntentCall);
};
-class StoryControllerImpl::StartContainerInShellCall : public Operation<> {
- public:
- StartContainerInShellCall(
- StoryControllerImpl* const story_controller_impl,
- std::vector<std::string> parent_module_path,
- std::string container_name,
- fuchsia::modular::SurfaceRelationPtr parent_relation,
- std::vector<fuchsia::modular::ContainerLayout> layout,
- std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
- std::vector<fuchsia::modular::ContainerNodePtr> nodes)
- : Operation("StoryControllerImpl::StartContainerInShellCall", [] {}),
- story_controller_impl_(story_controller_impl),
- parent_module_path_(std::move(parent_module_path)),
- container_name_(container_name),
- parent_relation_(std::move(parent_relation)),
- layout_(std::move(layout)),
- relationships_(std::move(relationships)),
- nodes_(std::move(nodes)) {
- for (auto& relationship : relationships_) {
- relation_map_[relationship.node_name] = CloneOptional(relationship);
- }
- }
-
- private:
- void Run() override {
- FlowToken flow{this};
- // parent + container used as module path of requesting module for
- // containers
- std::vector<std::string> module_path = parent_module_path_;
- // module_path.push_back(container_name_);
- // Adding non-module 'container_name_' to the module path results in
- // Ledger Client issuing a ReadData() call and failing with a fatal error
- // when module_data cannot be found
- // TODO(djmurphy): follow up, probably make containers modules
- std::vector<FuturePtr<fuchsia::modular::StartModuleStatus>> did_add_intents;
- did_add_intents.reserve(nodes_.size());
-
- for (size_t i = 0; i < nodes_.size(); ++i) {
- auto did_add_intent = Future<fuchsia::modular::StartModuleStatus>::Create(
- "StoryControllerImpl.StartContainerInShellCall.Run.did_add_intent");
- auto intent = fuchsia::modular::Intent::New();
- nodes_.at(i)->intent.Clone(intent.get());
- operation_queue_.Add(new AddIntentCall(
- story_controller_impl_, parent_module_path_,
- nodes_.at(i)->node_name, std::move(intent),
- nullptr /* module_controller_request */,
- fidl::MakeOptional(
- relation_map_[nodes_.at(i)->node_name]->relationship),
- nullptr /* view_owner_request */,
- fuchsia::modular::ModuleSource::INTERNAL,
- did_add_intent->Completer()));
-
- did_add_intents.emplace_back(did_add_intent);
- }
-
- Wait<Future<>>("StoryControllerImpl.StartContainerInShellCall.Run.Wait",
- did_add_intents)
- ->Then([this, flow] {
- if (!story_controller_impl_->story_shell_) {
- return;
- }
- std::vector<fuchsia::modular::ContainerView> views(nodes_.size());
- for (size_t i = 0; i < nodes_.size(); i++) {
- fuchsia::modular::ContainerView view;
- view.node_name = nodes_.at(i)->node_name;
- view.owner = std::move(node_views_[nodes_.at(i)->node_name]);
- views.at(i) = std::move(view);
- }
- story_controller_impl_->story_shell_->AddContainer(
- container_name_, ModulePathToSurfaceID(parent_module_path_),
- std::move(*parent_relation_), std::move(layout_),
- std::move(relationships_), std::move(views));
- });
- }
-
- StoryControllerImpl* const story_controller_impl_; // not owned
- OperationQueue operation_queue_;
- const std::vector<std::string> parent_module_path_;
- const std::string container_name_;
-
- fuchsia::modular::SurfaceRelationPtr parent_relation_;
- std::vector<fuchsia::modular::ContainerLayout> layout_;
- std::vector<fuchsia::modular::ContainerRelationEntry> relationships_;
- const std::vector<fuchsia::modular::ContainerNodePtr> nodes_;
- std::map<std::string, fuchsia::modular::ContainerRelationEntryPtr>
- relation_map_;
-
- // map of node_name to view_owners
- std::map<std::string, fuchsia::ui::viewsv1token::ViewOwnerPtr>
- node_views_;
-
- FXL_DISALLOW_COPY_AND_ASSIGN(StartContainerInShellCall);
-};
-
class StoryControllerImpl::StartCall : public Operation<> {
public:
StartCall(
@@ -1344,17 +1250,6 @@
std::move(callback)));
}
-void StoryControllerImpl::StartContainerInShell(
- const std::vector<std::string>& parent_module_path,
- std::string name, fuchsia::modular::SurfaceRelationPtr parent_relation,
- std::vector<fuchsia::modular::ContainerLayout> layout,
- std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
- std::vector<fuchsia::modular::ContainerNodePtr> nodes) {
- operation_queue_.Add(new StartContainerInShellCall(
- this, parent_module_path, name, std::move(parent_relation),
- std::move(layout), std::move(relationships), std::move(nodes)));
-}
-
void StoryControllerImpl::ProcessPendingViews() {
// NOTE(mesch): As it stands, this machinery to send modules in traversal
// order to the story shell is N^3 over the lifetime of the story, where N
diff --git a/bin/sessionmgr/story_runner/story_controller_impl.h b/bin/sessionmgr/story_runner/story_controller_impl.h
index a9b6d23dac..c72b43c 100644
--- a/bin/sessionmgr/story_runner/story_controller_impl.h
+++ b/bin/sessionmgr/story_runner/story_controller_impl.h
@@ -130,15 +130,6 @@
fuchsia::modular::ModuleSource module_source,
std::function<void(fuchsia::modular::StartModuleStatus)> callback);
- // Called by ModuleContextImpl.
- void StartContainerInShell(
- const std::vector<std::string>& parent_module_path,
- std::string name,
- fuchsia::modular::SurfaceRelationPtr parent_relation,
- std::vector<fuchsia::modular::ContainerLayout> layout,
- std::vector<fuchsia::modular::ContainerRelationEntry> relationships,
- std::vector<fuchsia::modular::ContainerNodePtr> nodes);
-
// Stops the module at |module_path| in response to a call to
// |ModuleContext.RemoveSelfFromStory|.
void RemoveModuleFromStory(
@@ -337,7 +328,6 @@
class OnModuleDataUpdatedCall;
class ResolveParameterCall;
class StartCall;
- class StartContainerInShellCall;
class StopCall;
class StopModuleCall;
class StopModuleAndStoryIfEmptyCall;
diff --git a/public/fidl/fuchsia.modular/module/module_context.fidl b/public/fidl/fuchsia.modular/module/module_context.fidl
index 09540cc..286f3c9 100644
--- a/public/fidl/fuchsia.modular/module/module_context.fidl
+++ b/public/fidl/fuchsia.modular/module/module_context.fidl
@@ -46,17 +46,13 @@
/// the view of the requested Module instance in the view of the requesting
/// Module instance, instead of relying on the story shell for display. If a
/// Module instance with the same [name] and [intent] is already running,
- /// [view_owner] is just closed.
+ /// [view_owner] is closed.
3: EmbedModule(string name, Intent intent,
request<ModuleController> module_controller,
request<fuchsia.ui.viewsv1token.ViewOwner> view_owner)
-> (StartModuleStatus status);
- /// Like StartModule(), but starts multiple modules simultaneously and
- /// specifies a custom layout for them (aka container).
- ///
- /// There are multiple layouts specified, for different screen sizes etc.
- /// DEPRECATED
+ /// DEPRECATED: no longer implemented.
6: StartContainerInShell(string container_name,
SurfaceRelation parent_relation,
vector<ContainerLayout> layout,
@@ -76,19 +72,11 @@
10: RequestFocus();
/// DEPRECATED in favor of using StartOngoingActivity().
- ///
- /// Declares that activity is ongoing in this module. This information is
- /// forwarded to the session shell (cf. StoryProvider.WatchActivity()
- /// and StoryProviderWatcher), which may use it and the frequency at which it
- /// receives these calls to determine to keep the story of this module in
- /// focus. The module should call this method regularly while activity is
- /// ongoing. Once the activity ceases, the module should just not issue calls
- /// anymore. See StoryProviderWatcher for more motivation.
11: Active();
/// When a module calls [RemoveSelfFromStory()] the framework will stop the
/// module and remove it from the story. If there are no more running modules
- /// in the story the story will be stopped.
+ /// in the story the story will be deleted.
16: RemoveSelfFromStory();
/// Requests to update the visibility state of the current story within the