| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |