| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/tools/package_manager/package_manager_application.h" | 5 #include "mojo/tools/package_manager/package_manager_application.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "mojo/tools/package_manager/manifest.h" | 8 #include "mojo/tools/package_manager/manifest.h" |
| 9 #include "mojo/tools/package_manager/unpacker.h" | 9 #include "mojo/tools/package_manager/unpacker.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 PackageManagerApplication::PackageManagerApplication() { | 29 PackageManagerApplication::PackageManagerApplication() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 PackageManagerApplication::~PackageManagerApplication() { | 32 PackageManagerApplication::~PackageManagerApplication() { |
| 33 STLDeleteContainerPairSecondPointers(pending_.begin(), pending_.end()); | 33 STLDeleteContainerPairSecondPointers(pending_.begin(), pending_.end()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void PackageManagerApplication::Initialize(ApplicationImpl* app) { | 36 void PackageManagerApplication::Initialize(ApplicationImpl* app) { |
| 37 app->ConnectToService("mojo:mojo_network_service", &network_service_); | 37 app->ConnectToService("mojo:network_service", &network_service_); |
| 38 | 38 |
| 39 printf("Enter URL> "); | 39 printf("Enter URL> "); |
| 40 char buf[1024]; | 40 char buf[1024]; |
| 41 if (scanf("%1023s", buf) != 1) { | 41 if (scanf("%1023s", buf) != 1) { |
| 42 printf("No input, exiting\n"); | 42 printf("No input, exiting\n"); |
| 43 base::MessageLoop::current()->Quit(); | 43 base::MessageLoop::current()->Quit(); |
| 44 return; | 44 return; |
| 45 } | 45 } |
| 46 GURL url(buf); | 46 GURL url(buf); |
| 47 if (!url.is_valid()) { | 47 if (!url.is_valid()) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 printf("Loaded %s\n", url.spec().c_str()); | 105 printf("Loaded %s\n", url.spec().c_str()); |
| 106 PendingLoadComplete(url); | 106 PendingLoadComplete(url); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void PackageManagerApplication::FetchFailed(const GURL& url) { | 109 void PackageManagerApplication::FetchFailed(const GURL& url) { |
| 110 PendingLoadComplete(url); | 110 PendingLoadComplete(url); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace mojo | 113 } // namespace mojo |
| OLD | NEW |