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

Side by Side Diff: mojo/runner/native_application_support.cc

Issue 1344933002: Clean up some unused methods from ApplicationManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « mojo/runner/native_application_support.h ('k') | mojo/runner/native_runner_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/runner/native_application_support.h" 5 #include "mojo/runner/native_application_support.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 29 matching lines...) Expand all
40 if (expected_size > sizeof(Thunks)) { 40 if (expected_size > sizeof(Thunks)) {
41 LOG(ERROR) << "Invalid app library: expected " << function_name 41 LOG(ERROR) << "Invalid app library: expected " << function_name
42 << " to return thunks of size: " << expected_size; 42 << " to return thunks of size: " << expected_size;
43 return false; 43 return false;
44 } 44 }
45 return true; 45 return true;
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 base::NativeLibrary LoadNativeApplication( 50 base::NativeLibrary LoadNativeApplication(const base::FilePath& app_path) {
51 const base::FilePath& app_path,
52 shell::NativeApplicationCleanup cleanup) {
53 DVLOG(2) << "Loading Mojo app in process from library: " << app_path.value(); 51 DVLOG(2) << "Loading Mojo app in process from library: " << app_path.value();
54 52
55 base::NativeLibraryLoadError error; 53 base::NativeLibraryLoadError error;
56 base::NativeLibrary app_library = base::LoadNativeLibrary(app_path, &error); 54 base::NativeLibrary app_library = base::LoadNativeLibrary(app_path, &error);
57 if (cleanup == shell::NativeApplicationCleanup::DELETE)
58 DeleteFile(app_path, false);
59 LOG_IF(ERROR, !app_library) 55 LOG_IF(ERROR, !app_library)
60 << "Failed to load app library (error: " << error.ToString() << ")"; 56 << "Failed to load app library (error: " << error.ToString() << ")";
61 return app_library; 57 return app_library;
62 } 58 }
63 59
64 bool RunNativeApplication(base::NativeLibrary app_library, 60 bool RunNativeApplication(base::NativeLibrary app_library,
65 InterfaceRequest<Application> application_request) { 61 InterfaceRequest<Application> application_request) {
66 // Tolerate |app_library| being null, to make life easier for callers. 62 // Tolerate |app_library| being null, to make life easier for callers.
67 if (!app_library) 63 if (!app_library)
68 return false; 64 return false;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 MojoHandle handle = application_request.PassMessagePipe().release().value(); 147 MojoHandle handle = application_request.PassMessagePipe().release().value();
152 MojoResult result = main_function(handle); 148 MojoResult result = main_function(handle);
153 if (result != MOJO_RESULT_OK) { 149 if (result != MOJO_RESULT_OK) {
154 LOG(ERROR) << "MojoMain returned error (result: " << result << ")"; 150 LOG(ERROR) << "MojoMain returned error (result: " << result << ")";
155 } 151 }
156 return true; 152 return true;
157 } 153 }
158 154
159 } // namespace runner 155 } // namespace runner
160 } // namespace mojo 156 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/native_application_support.h ('k') | mojo/runner/native_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698