[modular] Remove StoryProvider.CreateStory*.

These methods are no longer used.

MF-13 #comment [modular] Remove StoryProvider.CreateStory*.
TEST=removing code

Change-Id: Ic9cb759b5c66d692597e5975f0f85b8f36665742
diff --git a/bin/sessionmgr/story_runner/story_provider_impl.cc b/bin/sessionmgr/story_runner/story_provider_impl.cc
index a6ff7e0..db42e32 100644
--- a/bin/sessionmgr/story_runner/story_provider_impl.cc
+++ b/bin/sessionmgr/story_runner/story_provider_impl.cc
@@ -44,89 +44,6 @@
 
 constexpr char kSnapshotLoaderUrl[] = "snapshot";
 
-// 1. Ask SessionStorage to create an ID and storage for the new story.
-// 2. Optionally add the module in |url| to the story.
-class StoryProviderImpl::CreateStoryCall : public Operation<fidl::StringPtr> {
- public:
-  CreateStoryCall(
-      SessionStorage* const session_storage,
-      StoryProviderImpl* const story_provider_impl, fidl::StringPtr url,
-      fidl::VectorPtr<fuchsia::modular::StoryInfoExtraEntry> extra_info,
-      fidl::StringPtr root_json, fuchsia::modular::StoryOptions story_options,
-      ResultCall result_call)
-      : Operation("StoryProviderImpl::CreateStoryCall", std::move(result_call)),
-        session_storage_(session_storage),
-        story_provider_impl_(story_provider_impl),
-        extra_info_(std::move(extra_info)),
-        story_options_(std::move(story_options)),
-        start_time_(zx_clock_get(ZX_CLOCK_UTC)) {
-    intent_.handler = std::move(url);
-
-    if (!root_json.is_null()) {
-      fuchsia::modular::IntentParameter param;
-      param.name = nullptr;
-      fsl::SizedVmo vmo;
-      FXL_CHECK(fsl::VmoFromString(*root_json, &vmo));
-      param.data.set_json(std::move(vmo).ToTransport());
-      intent_.parameters.push_back(std::move(param));
-    }
-  }
-
- private:
-  void Run() override {
-    FlowToken flow{this, &story_id_};
-
-    // Steps:
-    // 1) Create the story storage.
-    // 2) Set any extra info.
-    // 3) If we got an initial module, add it.
-    session_storage_
-        ->CreateStory(std::move(extra_info_), std::move(story_options_))
-        ->WeakAsyncMap(GetWeakPtr(),
-                       [this, flow](fidl::StringPtr story_id,
-                                    fuchsia::ledger::PageId page_id) {
-                         story_id_ = story_id;
-                         return session_storage_->GetStoryStorage(story_id_);
-                       })
-        ->WeakThen(GetWeakPtr(),
-                   [this, flow](std::unique_ptr<StoryStorage> story_storage) {
-                     storage_ = std::move(story_storage);
-                     controller_ = std::make_unique<StoryControllerImpl>(
-                         story_id_, session_storage_, storage_.get(),
-                         story_provider_impl_);
-                     if (intent_.handler) {
-                       controller_->AddModule(
-                           {} /* parent_module_path */, kRootModuleName,
-                           std::move(intent_), nullptr /* surface_relation */);
-                     }
-
-                     // We ensure that everything has been written to the story
-                     // page before this operation is done.
-                     controller_->Sync([flow] {});
-
-                     ReportStoryLaunchTime(zx::duration(
-                         zx_clock_get(ZX_CLOCK_UTC) - start_time_));
-                   });
-  }
-
-  SessionStorage* const session_storage_;         // Not owned
-  StoryProviderImpl* const story_provider_impl_;  // Not owned
-  fuchsia::modular::Intent intent_;
-  fidl::VectorPtr<fuchsia::modular::StoryInfoExtraEntry> extra_info_;
-  fuchsia::modular::StoryOptions story_options_;
-  const zx_time_t start_time_;
-
-  std::unique_ptr<StoryStorage> storage_;
-  std::unique_ptr<StoryControllerImpl> controller_;
-
-  fidl::StringPtr story_id_;  // This is the result of the Operation.
-
-  // Sub operations run in this queue.
-  OperationQueue operation_queue_;
-
-  FXL_DISALLOW_COPY_AND_ASSIGN(CreateStoryCall);
-};
-
 class StoryProviderImpl::DeleteStoryCall : public Operation<> {
  public:
   using StoryRuntimesMap = std::map<std::string, struct StoryRuntimeContainer>;
@@ -518,37 +435,6 @@
 }
 
 // |fuchsia::modular::StoryProvider|
-void StoryProviderImpl::CreateStory(fidl::StringPtr module_url,
-                                    CreateStoryCallback callback) {
-  FXL_LOG(INFO) << "fuchsia::modular::CreateStory() " << module_url;
-  operation_queue_.Add(new CreateStoryCall(
-      session_storage_, this, module_url, nullptr /* extra_info */,
-      nullptr /* root_json */, {} /* story_options */, callback));
-}
-
-// |fuchsia::modular::StoryProvider|
-void StoryProviderImpl::CreateStoryWithOptions(
-    fuchsia::modular::StoryOptions story_options,
-    CreateStoryWithOptionsCallback callback) {
-  FXL_LOG(INFO) << "CreateStoryWithOptions() ";
-  operation_queue_.Add(
-      new CreateStoryCall(session_storage_, this, nullptr /* module_url */,
-                          nullptr /* extra_info */, nullptr /* root_json */,
-                          std::move(story_options), callback));
-}
-
-// |fuchsia::modular::StoryProvider|
-void StoryProviderImpl::CreateStoryWithInfo(
-    fidl::StringPtr module_url,
-    fidl::VectorPtr<fuchsia::modular::StoryInfoExtraEntry> extra_info,
-    fidl::StringPtr root_json, CreateStoryWithInfoCallback callback) {
-  FXL_LOG(INFO) << "CreateStoryWithInfo() " << module_url << " " << root_json;
-  operation_queue_.Add(new CreateStoryCall(
-      session_storage_, this, module_url, std::move(extra_info),
-      std::move(root_json), {} /* story_options */, callback));
-}
-
-// |fuchsia::modular::StoryProvider|
 void StoryProviderImpl::DeleteStory(fidl::StringPtr story_id,
                                     DeleteStoryCallback callback) {
   operation_queue_.Add(new DeleteStoryCall(
diff --git a/bin/sessionmgr/story_runner/story_provider_impl.h b/bin/sessionmgr/story_runner/story_provider_impl.h
index fdcda1e..3b4bcdf 100644
--- a/bin/sessionmgr/story_runner/story_provider_impl.h
+++ b/bin/sessionmgr/story_runner/story_provider_impl.h
@@ -177,20 +177,6 @@
 
  private:
   // |fuchsia::modular::StoryProvider|
-  void CreateStory(fidl::StringPtr module_url,
-                   CreateStoryCallback callback) override;
-
-  // |fuchsia::modular::StoryProvider|
-  void CreateStoryWithOptions(fuchsia::modular::StoryOptions story_options,
-                              CreateStoryWithOptionsCallback callback) override;
-
-  // |fuchsia::modular::StoryProvider|
-  void CreateStoryWithInfo(
-      fidl::StringPtr module_url,
-      fidl::VectorPtr<fuchsia::modular::StoryInfoExtraEntry> extra_info,
-      fidl::StringPtr root_json, CreateStoryWithInfoCallback callback) override;
-
-  // |fuchsia::modular::StoryProvider|
   void DeleteStory(fidl::StringPtr story_id,
                    DeleteStoryCallback callback) override;
 
diff --git a/lib/testing/story_provider_mock.h b/lib/testing/story_provider_mock.h
index 1cdb62a..c0c694c 100644
--- a/lib/testing/story_provider_mock.h
+++ b/lib/testing/story_provider_mock.h
@@ -45,33 +45,6 @@
 
  private:
   // |fuchsia::modular::StoryProvider|
-  void CreateStory(fidl::StringPtr url, CreateStoryCallback callback) override {
-    last_created_story_ = url;
-    callback("foo");
-  }
-
-  // |fuchsia::modular::StoryProvider|
-  void CreateStoryWithInfo(
-      fidl::StringPtr url,
-      fidl::VectorPtr<fuchsia::modular::StoryInfoExtraEntry> extra_info,
-      fidl::StringPtr json, CreateStoryWithInfoCallback callback) override {
-    last_created_story_ = url;
-    callback("foo");
-  }
-
-  // |fuchsia::modular::StoryProvider|
-  void CreateStoryWithOptions(
-      fuchsia::modular::StoryOptions story_options,
-      CreateStoryWithOptionsCallback callback) override {
-    if (story_options.kind_of_proto_story) {
-      last_created_kind_of_proto_story_ = "kindoffoo";
-    } else {
-      last_created_story_ = "kindoffoo";
-    }
-    callback("kindoffoo");
-  }
-
-  // |fuchsia::modular::StoryProvider|
   void GetStories(
       fidl::InterfaceHandle<fuchsia::modular::StoryProviderWatcher> watcher,
       GetStoriesCallback callback) override {
diff --git a/public/fidl/fuchsia.modular/story/story_provider.fidl b/public/fidl/fuchsia.modular/story/story_provider.fidl
index 899e35a..dc0fea6 100644
--- a/public/fidl/fuchsia.modular/story/story_provider.fidl
+++ b/public/fidl/fuchsia.modular/story/story_provider.fidl
@@ -12,28 +12,6 @@
 // framework.
 [Discoverable]
 interface StoryProvider {
-    // Creates a new story. If |module_url| is supplied, adds it to the story as
-    // the first module. The returned |story_id| can be used to obtain a
-    // StoryController connection to perform actions on the newly created story,
-    // specifically starting it.
-    //
-    // Providing |module_url| is deprecated. It is preferred to GetController()
-    // and call StoryController.AddModule().
-    //
-    // DEPRECATED: To create and modify existing stories, use PuppetMaster.
-    1: CreateStory(string? module_url) -> (string story_id);
-
-    // Like CreateStory(), but with extra info and with values for the root link
-    // atomically set.
-    //
-    // Providing |module_url| is deprecated. It is preferred to GetController()
-    // and call StoryController.AddModule().
-    //
-    // DEPRECATED: To create and modify existing stories, use PuppetMaster.
-    2: CreateStoryWithInfo(string? module_url,
-                           vector<StoryInfoExtraEntry>? extra_info,
-                           string? root_json) -> (string story_id);
-
     // Deletes an existing story from the list of known stories. Returns when the
     // delete notification is received from the Ledger. If the story to be deleted
     // is running, it is first stopped and its story controller disconnected. If
@@ -75,13 +53,6 @@
     // StoryActivityWatcher.OnStoryActivity() will be called to update clients
     // with the initial data. See StoryActivityWatcher for motivations.
     10: WatchActivity(StoryActivityWatcher watcher);
-
-    // Creates a story and sets the options it will have.
-    // EXPERIMENTAL
-    //
-    // DEPRECATED: To create stories, use PuppetMaster.
-    11: CreateStoryWithOptions(StoryOptions story_options)
-            -> (string story_id);
 };
 
 // Implemented by clients of StoryProvider.