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

Side by Side Diff: mojo/shell/mojo_url_resolver.cc

Issue 668483002: Change mojo URLs from mojo://mojo_foo to mojo://foo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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/shell/dynamic_application_loader.cc ('k') | mojo/shell/mojo_url_resolver_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/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
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
OLDNEW
« no previous file with comments | « mojo/shell/dynamic_application_loader.cc ('k') | mojo/shell/mojo_url_resolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698