diff options
author | ben <ben@chromium.org> | 2016-02-17 18:10:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-18 02:11:20 +0000 |
commit | 41f2fe9d2925a4cb17582dfa974217f5765e83d5 (patch) | |
tree | 7a62c50d0f30034e940e8f4e031c6164f5a704eb /mojo/shell/standalone | |
parent | df7c0802a46e34a48c5497a9133dddd25b94a14f (diff) | |
download | chromium_src-41f2fe9d2925a4cb17582dfa974217f5765e83d5.zip chromium_src-41f2fe9d2925a4cb17582dfa974217f5765e83d5.tar.gz chromium_src-41f2fe9d2925a4cb17582dfa974217f5765e83d5.tar.bz2 |
Remove the old package manager
BUG=
Review URL: https://codereview.chromium.org/1701933004
Cr-Commit-Position: refs/heads/master@{#376064}
Diffstat (limited to 'mojo/shell/standalone')
-rw-r--r-- | mojo/shell/standalone/BUILD.gn | 17 | ||||
-rw-r--r-- | mojo/shell/standalone/context.cc | 68 | ||||
-rw-r--r-- | mojo/shell/standalone/context.h | 5 | ||||
-rw-r--r-- | mojo/shell/standalone/register_local_aliases.cc | 13 | ||||
-rw-r--r-- | mojo/shell/standalone/register_local_aliases.h | 17 |
5 files changed, 3 insertions, 117 deletions
diff --git a/mojo/shell/standalone/BUILD.gn b/mojo/shell/standalone/BUILD.gn index e87bea5..d8a3aca 100644 --- a/mojo/shell/standalone/BUILD.gn +++ b/mojo/shell/standalone/BUILD.gn @@ -11,12 +11,6 @@ if (is_android) { import("//build/config/android/rules.gni") } -source_set("register_local_aliases_fwd") { - sources = [ - "register_local_aliases.h", - ] -} - # main() entrypoint definition is structured into a static lib for Android's # benefit, as it is shared between the standalone executable and other # executables (e.g. Mandoline). @@ -35,11 +29,7 @@ source_set("main_lib") { ] if (!is_android) { - sources += [ - "desktop/main.cc", - "register_local_aliases.cc", - "register_local_aliases.h", - ] + sources += [ "desktop/main.cc" ] deps += [ "//components/tracing:startup_tracing", "//third_party/icu:icudata", @@ -74,12 +64,10 @@ executable("standalone") { if (is_android) { sources = [ "android/context_init.cc", - "register_local_aliases.cc", ] deps += [ ":lib", - ":register_local_aliases_fwd", "//mojo/edk/system", ] @@ -112,7 +100,6 @@ source_set("lib") { "//mojo/services/tracing/public/cpp", "//mojo/services/tracing/public/interfaces", "//mojo/shell", - "//mojo/shell/package_manager", "//mojo/shell/public/cpp", "//mojo/shell/runner:init", "//mojo/shell/runner/child:interfaces", @@ -204,8 +191,6 @@ if (is_android) { shared_library("bootstrap") { sources = [ "android/bootstrap.cc", - "register_local_aliases.cc", - "register_local_aliases.h", ] deps = [ ":jni_headers", diff --git a/mojo/shell/standalone/context.cc b/mojo/shell/standalone/context.cc index 921ab99..adc285d 100644 --- a/mojo/shell/standalone/context.cc +++ b/mojo/shell/standalone/context.cc @@ -33,11 +33,8 @@ #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" #include "mojo/shell/application_loader.h" #include "mojo/shell/connect_to_application_params.h" -#include "mojo/shell/package_manager/package_manager_impl.h" -#include "mojo/shell/query_util.h" #include "mojo/shell/runner/host/in_process_native_runner.h" #include "mojo/shell/runner/host/out_of_process_native_runner.h" -#include "mojo/shell/standalone/register_local_aliases.h" #include "mojo/shell/standalone/switches.h" #include "mojo/shell/standalone/tracer.h" #include "mojo/shell/switches.h" @@ -59,59 +56,6 @@ class Setup { DISALLOW_COPY_AND_ASSIGN(Setup); }; -void InitContentHandlers(PackageManagerImpl* manager, - const base::CommandLine& command_line) { - // Default content handlers. - manager->RegisterContentHandler("application/javascript", - GURL("mojo:html_viewer")); - manager->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer")); - manager->RegisterContentHandler("image/gif", GURL("mojo:html_viewer")); - manager->RegisterContentHandler("image/jpeg", GURL("mojo:html_viewer")); - manager->RegisterContentHandler("image/png", GURL("mojo:html_viewer")); - manager->RegisterContentHandler("text/css", GURL("mojo:html_viewer")); - manager->RegisterContentHandler("text/html", GURL("mojo:html_viewer")); - manager->RegisterContentHandler("text/plain", GURL("mojo:html_viewer")); - - // Command-line-specified content handlers. - std::string handlers_spec = - command_line.GetSwitchValueASCII(switches::kContentHandlers); - if (handlers_spec.empty()) - return; - -#if defined(OS_ANDROID) - // TODO(eseidel): On Android we pass command line arguments is via the - // 'parameters' key on the intent, which we specify during 'am shell start' - // via --esa, however that expects comma-separated values and says: - // am shell --help: - // [--esa <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]] - // (to embed a comma into a string escape it using "\,") - // Whatever takes 'parameters' and constructs a CommandLine is failing to - // un-escape the commas, we need to move this fix to that file. - base::ReplaceSubstringsAfterOffset(&handlers_spec, 0, "\\,", ","); -#endif - - std::vector<std::string> parts = base::SplitString( - handlers_spec, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - if (parts.size() % 2 != 0) { - LOG(ERROR) << "Invalid value for switch " << switches::kContentHandlers - << ": must be a comma-separated list of mimetype/url pairs." - << handlers_spec; - return; - } - - for (size_t i = 0; i < parts.size(); i += 2) { - GURL url(parts[i + 1]); - if (!url.is_valid()) { - LOG(ERROR) << "Invalid value for switch " << switches::kContentHandlers - << ": '" << parts[i + 1] << "' is not a valid URL."; - return; - } - // TODO(eseidel): We should also validate that the mimetype is valid - // net/base/mime_util.h could do this, but we don't want to depend on net. - manager->RegisterContentHandler(parts[i], url); - } -} - class TracingInterfaceProvider : public shell::mojom::InterfaceProvider { public: TracingInterfaceProvider(Tracer* tracer, @@ -137,8 +81,7 @@ class TracingInterfaceProvider : public shell::mojom::InterfaceProvider { } // namespace -Context::Context() - : package_manager_(nullptr), main_entry_time_(base::Time::Now()) {} +Context::Context() : main_entry_time_(base::Time::Now()) {} Context::~Context() { DCHECK(!base::MessageLoop::current()); @@ -170,12 +113,6 @@ void Context::Init(const base::FilePath& shell_file_root) { // TODO(vtl): This should be MASTER, not NONE. edk::InitIPCSupport(this, task_runners_->io_runner()); - package_manager_ = new PackageManagerImpl( - shell_file_root, task_runners_->blocking_pool(), nullptr); - InitContentHandlers(package_manager_, command_line); - - RegisterLocalAliases(package_manager_); - scoped_ptr<NativeRunnerFactory> runner_factory; if (command_line.HasSwitch(switches::kSingleProcess)) { #if defined(COMPONENT_BUILD) @@ -190,8 +127,7 @@ void Context::Init(const base::FilePath& shell_file_root) { new OutOfProcessNativeRunnerFactory(task_runners_->blocking_pool())); } application_manager_.reset(new ApplicationManager( - make_scoped_ptr(package_manager_), std::move(runner_factory), - task_runners_->blocking_pool(), true)); + std::move(runner_factory), task_runners_->blocking_pool(), true)); shell::mojom::InterfaceProviderPtr tracing_remote_interfaces; shell::mojom::InterfaceProviderPtr tracing_local_interfaces; diff --git a/mojo/shell/standalone/context.h b/mojo/shell/standalone/context.h index fc923d2..f87b82c 100644 --- a/mojo/shell/standalone/context.h +++ b/mojo/shell/standalone/context.h @@ -21,7 +21,6 @@ namespace mojo { namespace shell { class NativeApplicationLoader; -class PackageManagerImpl; // The "global" context for the shell's main process. class Context : public edk::ProcessDelegate { @@ -52,8 +51,6 @@ class Context : public edk::ProcessDelegate { return application_manager_.get(); } - PackageManagerImpl* package_manager() { return package_manager_; } - private: class NativeViewportApplicationLoader; @@ -68,8 +65,6 @@ class Context : public edk::ProcessDelegate { // Ensure this is destructed before task_runners_ since it owns a message pipe // that needs the IO thread to destruct cleanly. Tracer tracer_; - // Owned by |application_manager_|. - PackageManagerImpl* package_manager_; scoped_ptr<ApplicationManager> application_manager_; base::Closure app_complete_callback_; base::Time main_entry_time_; diff --git a/mojo/shell/standalone/register_local_aliases.cc b/mojo/shell/standalone/register_local_aliases.cc deleted file mode 100644 index 0b43bd8..0000000 --- a/mojo/shell/standalone/register_local_aliases.cc +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2015 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 "mojo/shell/standalone/register_local_aliases.h" - -namespace mojo { -namespace shell { - -void RegisterLocalAliases(PackageManagerImpl* manager) {} - -} // namespace shell -} // namespace mojo diff --git a/mojo/shell/standalone/register_local_aliases.h b/mojo/shell/standalone/register_local_aliases.h deleted file mode 100644 index 5211587..0000000 --- a/mojo/shell/standalone/register_local_aliases.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 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. - -#ifndef MOJO_SHELL_STANDALONE_REGISTER_LOCAL_ALIASES_H_ -#define MOJO_SHELL_STANDALONE_REGISTER_LOCAL_ALIASES_H_ - -namespace mojo { -namespace shell { -class PackageManagerImpl; - -void RegisterLocalAliases(PackageManagerImpl* manager); - -} // namespace shell -} // namespace mojo - -#endif // MOJO_SHELL_STANDALONE_REGISTER_LOCAL_ALIASES_H_ |