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

Side by Side Diff: services/service_manager/service_manager.cc

Issue 2552873002: Don't CHECK in service manager when loading service from disk package (Closed)
Patch Set: remove include Created 4 years 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 | « no previous file | no next file » | 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 "services/service_manager/service_manager.h" 5 #include "services/service_manager/service_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/debug/alias.h"
14 #include "base/guid.h" 13 #include "base/guid.h"
15 #include "base/logging.h" 14 #include "base/logging.h"
16 #include "base/macros.h" 15 #include "base/macros.h"
17 #include "base/process/process.h" 16 #include "base/process/process.h"
18 #include "base/process/process_handle.h" 17 #include "base/process/process_handle.h"
19 #include "base/stl_util.h" 18 #include "base/stl_util.h"
20 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
21 #include "base/trace_event/trace_event.h" 20 #include "base/trace_event/trace_event.h"
22 #include "mojo/public/cpp/bindings/associated_binding.h" 21 #include "mojo/public/cpp/bindings/associated_binding.h"
23 #include "mojo/public/cpp/bindings/binding.h" 22 #include "mojo/public/cpp/bindings/binding.h"
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 Identity factory(result->resolved_name, target_user_id, 920 Identity factory(result->resolved_name, target_user_id,
922 factory_instance_name); 921 factory_instance_name);
923 CreateServiceWithFactory(factory, target.name(), std::move(request)); 922 CreateServiceWithFactory(factory, target.name(), std::move(request));
924 } else { 923 } else {
925 base::FilePath package_path; 924 base::FilePath package_path;
926 if (!service_overrides_ || !service_overrides_->GetExecutablePathOverride( 925 if (!service_overrides_ || !service_overrides_->GetExecutablePathOverride(
927 target.name(), &package_path)) { 926 target.name(), &package_path)) {
928 package_path = result->package_path; 927 package_path = result->package_path;
929 } 928 }
930 929
931 Identity source_instance_identity; 930 // TODO(rockot): Find a way to block this code path for content but allow
932 base::debug::Alias(&has_source_instance); 931 // it for chrome_mash.
933 base::debug::Alias(&package_path);
934 base::debug::Alias(&source);
935 base::debug::Alias(&target);
936 if (source_instance)
937 source_instance_identity = source_instance->identity();
938 base::debug::Alias(&source_instance_identity);
939 #if defined(GOOGLE_CHROME_BUILD)
940 // We do not currently want to hit this code path in production, but it's
941 // happening somehow. https://crbug.com/649673.
942 CHECK(false);
943 #endif
944 instance->StartWithFilePath(package_path); 932 instance->StartWithFilePath(package_path);
945 } 933 }
946 } 934 }
947 935
948 // Now that the instance has a Service, we can connect to it. 936 // Now that the instance has a Service, we can connect to it.
949 bool connected = instance->ConnectToService(&params); 937 bool connected = instance->ConnectToService(&params);
950 DCHECK(connected); 938 DCHECK(connected);
951 } 939 }
952 940
953 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() { 941 base::WeakPtr<ServiceManager> ServiceManager::GetWeakPtr() {
954 return weak_ptr_factory_.GetWeakPtr(); 942 return weak_ptr_factory_.GetWeakPtr();
955 } 943 }
956 944
957 } // namespace service_manager 945 } // namespace service_manager
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698