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

Unified Diff: sky/shell/linux/main.cc

Issue 1211253004: Add MineDigger.apk that works offline (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: one more examples Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/android/org/domokit/sky/shell/SkyApplication.java ('k') | sky/shell/ui/engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/linux/main.cc
diff --git a/sky/shell/linux/main.cc b/sky/shell/linux/main.cc
index b40223d582d6901c199001e091642ae33c6bc8f6..f6beeabe2d708995ed79105828bc36b44d8583a5 100644
--- a/sky/shell/linux/main.cc
+++ b/sky/shell/linux/main.cc
@@ -8,12 +8,9 @@
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/files/file_path.h"
#include "base/i18n/icu_util.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
-#include "base/threading/worker_pool.h"
-#include "mojo/common/data_pipe_utils.h"
#include "sky/shell/platform_view.h"
#include "sky/shell/service_provider.h"
#include "sky/shell/shell.h"
@@ -24,14 +21,10 @@ namespace sky {
namespace shell {
namespace {
-void Ignored(bool) {
-}
-
void Usage() {
std::cerr << "Usage: sky_shell"
- << " [--" << switches::kPackageRoot << "]"
- << " [--" << switches::kSnapshot << "]"
- << " <sky-app>" << std::endl;
+ << " [MAIN_DART --" << switches::kPackageRoot << "=PACKAGE_ROOT]"
+ << " [--" << switches::kSnapshot << "=SNAPSHOT]" << std::endl;
}
void Init() {
@@ -46,20 +39,15 @@ void Init() {
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
- std::string main = command_line.GetArgs()[0];
if (command_line.HasSwitch(switches::kSnapshot)) {
- base::FilePath snapshot =
- command_line.GetSwitchValuePath(switches::kSnapshot);
- mojo::DataPipe pipe;
- viewport_observer->RunFromSnapshot(main, pipe.consumer_handle.Pass());
- scoped_refptr<base::TaskRunner> runner =
- base::WorkerPool::GetTaskRunner(true);
- mojo::common::CopyFromFile(snapshot, pipe.producer_handle.Pass(), 0,
- runner.get(), base::Bind(&Ignored));
+ std::string snapshot =
+ command_line.GetSwitchValueASCII(switches::kSnapshot);
+ viewport_observer->RunFromSnapshot(snapshot);
return;
}
if (command_line.HasSwitch(switches::kPackageRoot)) {
+ std::string main = command_line.GetArgs()[0];
std::string package_root =
command_line.GetSwitchValueASCII(switches::kPackageRoot);
viewport_observer->RunFromFile(main, package_root);
@@ -80,8 +68,7 @@ int main(int argc, const char* argv[]) {
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(sky::shell::switches::kHelp) ||
- command_line.GetArgs().empty()) {
+ if (command_line.HasSwitch(sky::shell::switches::kHelp)) {
sky::shell::Usage();
return 0;
}
« no previous file with comments | « sky/shell/android/org/domokit/sky/shell/SkyApplication.java ('k') | sky/shell/ui/engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698