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

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

Issue 292743017: Cleanup: Use base::CommandLine in mojo/ (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « mojo/shell/desktop/mojo_main.cc ('k') | mojo/shell/loader.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/dynamic_service_loader.h" 5 #include "mojo/shell/dynamic_service_loader.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "mojo/shell/context.h" 9 #include "mojo/shell/context.h"
10 #include "mojo/shell/keep_alive.h" 10 #include "mojo/shell/keep_alive.h"
(...skipping 27 matching lines...) Expand all
38 scoped_ptr<DynamicServiceRunner> runner) 38 scoped_ptr<DynamicServiceRunner> runner)
39 : loader_(loader), 39 : loader_(loader),
40 url_(url), 40 url_(url),
41 service_handle_(service_handle.Pass()), 41 service_handle_(service_handle.Pass()),
42 runner_(runner.Pass()), 42 runner_(runner.Pass()),
43 keep_alive_(loader->context_) { 43 keep_alive_(loader->context_) {
44 GURL url_to_load; 44 GURL url_to_load;
45 45
46 if (url.SchemeIs("mojo")) { 46 if (url.SchemeIs("mojo")) {
47 std::string origin = 47 std::string origin =
48 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 48 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
49 switches::kOrigin); 49 switches::kOrigin);
50 std::string lib = MakeSharedLibraryName(url.ExtractFileName()); 50 std::string lib = MakeSharedLibraryName(url.ExtractFileName());
51 url_to_load = GURL(origin + "/" + lib); 51 url_to_load = GURL(origin + "/" + lib);
52 } else { 52 } else {
53 url_to_load = url; 53 url_to_load = url;
54 } 54 }
55 55
56 request_ = loader_->context_->loader()->Load(url_to_load, this); 56 request_ = loader_->context_->loader()->Load(url_to_load, this);
57 } 57 }
58 58
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 DCHECK(it != url_to_load_context_.end()) << url; 117 DCHECK(it != url_to_load_context_.end()) << url;
118 118
119 LoadContext* doomed = it->second; 119 LoadContext* doomed = it->second;
120 url_to_load_context_.erase(it); 120 url_to_load_context_.erase(it);
121 121
122 delete doomed; 122 delete doomed;
123 } 123 }
124 124
125 } // namespace shell 125 } // namespace shell
126 } // namespace mojo 126 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/desktop/mojo_main.cc ('k') | mojo/shell/loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698