Chromium Code Reviews| 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/shell/mojo_url_resolver.h" | 5 #include "mojo/shell/mojo_url_resolver.h" | 
| 6 | 6 | 
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" | 
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" | 
| 9 #include "base/logging.h" | 9 #include "base/logging.h" | 
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" | 
| 11 #include "base/strings/string_util.h" | |
| 11 #include "net/base/filename_util.h" | 12 #include "net/base/filename_util.h" | 
| 12 #include "url/url_util.h" | 13 #include "url/url_util.h" | 
| 13 | 14 | 
| 14 namespace mojo { | 15 namespace mojo { | 
| 15 namespace shell { | 16 namespace shell { | 
| 16 namespace { | 17 namespace { | 
| 17 | 18 | 
| 18 std::string MakeSharedLibraryName(const std::string& host_name) { | 19 std::string MakeSharedLibraryName(std::string host_name) { | 
| 20 // TODO(aa): This should go away soon. In the Chromium repo, all the app | |
| 21 // target names start with "mojo_" by convention. But when we have an SDK, | |
| 22 // one would assume the libraries would have names that don't have this bit. | |
| 23 std::string prefix = "mojo_"; | |
| 24 if (!StartsWithASCII(host_name, prefix, true)) | |
| 25 host_name = prefix + host_name; | |
| 
 
abarth-chromium
2014/10/20 16:34:15
This broke Sky because the sky targets are prefixe
 
 | |
| 26 | |
| 19 #if defined(OS_WIN) | 27 #if defined(OS_WIN) | 
| 20 return host_name + ".dll"; | 28 return host_name + ".dll"; | 
| 21 #elif defined(OS_LINUX) || defined(OS_ANDROID) | 29 #elif defined(OS_LINUX) || defined(OS_ANDROID) | 
| 22 return "lib" + host_name + ".so"; | 30 return "lib" + host_name + ".so"; | 
| 23 #elif defined(OS_MACOSX) | 31 #elif defined(OS_MACOSX) | 
| 24 return host_name + ".so"; | 32 return host_name + ".so"; | 
| 25 #else | 33 #else | 
| 26 NOTREACHED() << "dynamic loading of services not supported"; | 34 NOTREACHED() << "dynamic loading of services not supported"; | 
| 27 return std::string(); | 35 return std::string(); | 
| 28 #endif | 36 #endif | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 std::map<GURL, GURL>::const_iterator it = url_map_.find(mapped_url); | 102 std::map<GURL, GURL>::const_iterator it = url_map_.find(mapped_url); | 
| 95 if (it == url_map_.end()) | 103 if (it == url_map_.end()) | 
| 96 break; | 104 break; | 
| 97 mapped_url = it->second; | 105 mapped_url = it->second; | 
| 98 } | 106 } | 
| 99 return mapped_url; | 107 return mapped_url; | 
| 100 } | 108 } | 
| 101 | 109 | 
| 102 } // namespace shell | 110 } // namespace shell | 
| 103 } // namespace mojo | 111 } // namespace mojo | 
| OLD | NEW |