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

Side by Side Diff: services/shell/runner/host/native_application_support.cc

Issue 2276133002: mojo_runner: Use prefer_own_symbols when loading DSOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native-library-local-symbols
Patch Set: rebase Created 4 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 | « no previous file | no next file » | 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 "services/shell/runner/host/native_application_support.h" 5 #include "services/shell/runner/host/native_application_support.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 23 matching lines...) Expand all
34 return false; 34 return false;
35 } 35 }
36 return true; 36 return true;
37 } 37 }
38 38
39 } // namespace 39 } // namespace
40 40
41 base::NativeLibrary LoadNativeApplication(const base::FilePath& app_path) { 41 base::NativeLibrary LoadNativeApplication(const base::FilePath& app_path) {
42 DVLOG(2) << "Loading Mojo app in process from library: " << app_path.value(); 42 DVLOG(2) << "Loading Mojo app in process from library: " << app_path.value();
43 43
44 base::NativeLibraryOptions options;
45 options.prefer_own_symbols = true;
46
44 base::NativeLibraryLoadError error; 47 base::NativeLibraryLoadError error;
45 base::NativeLibrary app_library = base::LoadNativeLibrary(app_path, &error); 48 base::NativeLibrary app_library = base::LoadNativeLibraryWithOptions(
49 app_path, options, &error);
46 LOG_IF(ERROR, !app_library) 50 LOG_IF(ERROR, !app_library)
47 << "Failed to load app library (path: " << app_path.value() 51 << "Failed to load app library (path: " << app_path.value()
48 << " reason: " << error.ToString() << ")"; 52 << " reason: " << error.ToString() << ")";
49 return app_library; 53 return app_library;
50 } 54 }
51 55
52 bool RunNativeApplication(base::NativeLibrary app_library, 56 bool RunNativeApplication(base::NativeLibrary app_library,
53 mojom::ServiceRequest request) { 57 mojom::ServiceRequest request) {
54 // Tolerate |app_library| being null, to make life easier for callers. 58 // Tolerate |app_library| being null, to make life easier for callers.
55 if (!app_library) 59 if (!app_library)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // |ServiceMain()| takes ownership of the service handle. 100 // |ServiceMain()| takes ownership of the service handle.
97 MojoHandle handle = request.PassMessagePipe().release().value(); 101 MojoHandle handle = request.PassMessagePipe().release().value();
98 MojoResult result = main_function(handle); 102 MojoResult result = main_function(handle);
99 if (result != MOJO_RESULT_OK) { 103 if (result != MOJO_RESULT_OK) {
100 LOG(ERROR) << "ServiceMain returned error (result: " << result << ")"; 104 LOG(ERROR) << "ServiceMain returned error (result: " << result << ")";
101 } 105 }
102 return true; 106 return true;
103 } 107 }
104 108
105 } // namespace shell 109 } // namespace shell
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698