| 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 "shell/application_manager/application_manager.h" | 5 #include "shell/application_manager/application_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 bool ApplicationManager::TestAPI::HasCreatedInstance() { | 88 bool ApplicationManager::TestAPI::HasCreatedInstance() { |
| 89 return has_created_instance; | 89 return has_created_instance; |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool ApplicationManager::TestAPI::HasFactoryForURL(const GURL& url) const { | 92 bool ApplicationManager::TestAPI::HasFactoryForURL(const GURL& url) const { |
| 93 return manager_->identity_to_shell_impl_.find(Identity(url)) != | 93 return manager_->identity_to_shell_impl_.find(Identity(url)) != |
| 94 manager_->identity_to_shell_impl_.end(); | 94 manager_->identity_to_shell_impl_.end(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 ApplicationManager::ApplicationManager(Delegate* delegate) | 97 ApplicationManager::ApplicationManager(const Options& options, |
| 98 : delegate_(delegate), | 98 Delegate* delegate) |
| 99 : options_(options), |
| 100 delegate_(delegate), |
| 99 blocking_pool_(nullptr), | 101 blocking_pool_(nullptr), |
| 100 disable_cache_(false), | |
| 101 weak_ptr_factory_(this) { | 102 weak_ptr_factory_(this) { |
| 102 } | 103 } |
| 103 | 104 |
| 104 ApplicationManager::~ApplicationManager() { | 105 ApplicationManager::~ApplicationManager() { |
| 105 } | 106 } |
| 106 | 107 |
| 107 void ApplicationManager::TerminateShellConnections() { | 108 void ApplicationManager::TerminateShellConnections() { |
| 108 identity_to_shell_impl_.clear(); | 109 identity_to_shell_impl_.clear(); |
| 109 } | 110 } |
| 110 | 111 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 callback); | 180 callback); |
| 180 return; | 181 return; |
| 181 } | 182 } |
| 182 | 183 |
| 183 if (!network_service_) { | 184 if (!network_service_) { |
| 184 ConnectToService(GURL("mojo:network_service"), &network_service_); | 185 ConnectToService(GURL("mojo:network_service"), &network_service_); |
| 185 ConnectToService(GURL("mojo:url_response_disk_cache"), | 186 ConnectToService(GURL("mojo:url_response_disk_cache"), |
| 186 &url_response_disk_cache_); | 187 &url_response_disk_cache_); |
| 187 } | 188 } |
| 188 | 189 |
| 189 new NetworkFetcher(disable_cache_, resolved_url, network_service_.get(), | 190 new NetworkFetcher(options_.disable_cache, options_.predictable_app_filenames, |
| 191 resolved_url, network_service_.get(), |
| 190 url_response_disk_cache_.get(), callback); | 192 url_response_disk_cache_.get(), callback); |
| 191 } | 193 } |
| 192 | 194 |
| 193 bool ApplicationManager::ConnectToRunningApplication( | 195 bool ApplicationManager::ConnectToRunningApplication( |
| 194 const GURL& resolved_url, | 196 const GURL& resolved_url, |
| 195 const GURL& requestor_url, | 197 const GURL& requestor_url, |
| 196 InterfaceRequest<ServiceProvider>* services, | 198 InterfaceRequest<ServiceProvider>* services, |
| 197 ServiceProviderPtr* exposed_services) { | 199 ServiceProviderPtr* exposed_services) { |
| 198 GURL application_url = GetBaseURLAndQuery(resolved_url, nullptr); | 200 GURL application_url = GetBaseURLAndQuery(resolved_url, nullptr); |
| 199 ShellImpl* shell_impl = GetShellImpl(application_url); | 201 ShellImpl* shell_impl = GetShellImpl(application_url); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 return args_it->second; | 479 return args_it->second; |
| 478 return std::vector<std::string>(); | 480 return std::vector<std::string>(); |
| 479 } | 481 } |
| 480 | 482 |
| 481 void ApplicationManager::CleanupRunner(NativeRunner* runner) { | 483 void ApplicationManager::CleanupRunner(NativeRunner* runner) { |
| 482 native_runners_.erase( | 484 native_runners_.erase( |
| 483 std::find(native_runners_.begin(), native_runners_.end(), runner)); | 485 std::find(native_runners_.begin(), native_runners_.end(), runner)); |
| 484 } | 486 } |
| 485 | 487 |
| 486 } // namespace shell | 488 } // namespace shell |
| OLD | NEW |