OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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/preferences/public/cpp/pref_service_factory.h" | 5 #include "services/preferences/public/cpp/pref_service_factory.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 service_manager::mojom::ServiceFactory> { | 35 service_manager::mojom::ServiceFactory> { |
36 public: | 36 public: |
37 ServiceTestClient(service_manager::test::ServiceTest* test, | 37 ServiceTestClient(service_manager::test::ServiceTest* test, |
38 scoped_refptr<base::SequencedWorkerPool> worker_pool) | 38 scoped_refptr<base::SequencedWorkerPool> worker_pool) |
39 : service_manager::test::ServiceTestClient(test), | 39 : service_manager::test::ServiceTestClient(test), |
40 worker_pool_(std::move(worker_pool)) { | 40 worker_pool_(std::move(worker_pool)) { |
41 registry_.AddInterface<service_manager::mojom::ServiceFactory>(this); | 41 registry_.AddInterface<service_manager::mojom::ServiceFactory>(this); |
42 } | 42 } |
43 | 43 |
44 protected: | 44 protected: |
45 void OnBindInterface(const service_manager::ServiceInfo& source_info, | 45 void OnBindInterface(const service_manager::BindSourceInfo& source_info, |
46 const std::string& interface_name, | 46 const std::string& interface_name, |
47 mojo::ScopedMessagePipeHandle interface_pipe) override { | 47 mojo::ScopedMessagePipeHandle interface_pipe) override { |
48 registry_.BindInterface(source_info.identity, interface_name, | 48 registry_.BindInterface(source_info.identity, interface_name, |
49 std::move(interface_pipe)); | 49 std::move(interface_pipe)); |
50 } | 50 } |
51 | 51 |
52 void CreateService(service_manager::mojom::ServiceRequest request, | 52 void CreateService(service_manager::mojom::ServiceRequest request, |
53 const std::string& name) override { | 53 const std::string& name) override { |
54 if (name == prefs::mojom::kServiceName) { | 54 if (name == prefs::mojom::kServiceName) { |
55 pref_service_context_.reset(new service_manager::ServiceContext( | 55 pref_service_context_.reset(new service_manager::ServiceContext( |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 } | 488 } |
489 PrefChangeRegistrar registrar; | 489 PrefChangeRegistrar registrar; |
490 registrar.Init(pref_service2.get()); | 490 registrar.Init(pref_service2.get()); |
491 registrar.Add(kDictionaryKey, base::Bind(&Fail, pref_service2.get())); | 491 registrar.Add(kDictionaryKey, base::Bind(&Fail, pref_service2.get())); |
492 pref_service->SetInteger(kKey, kUpdatedValue); | 492 pref_service->SetInteger(kKey, kUpdatedValue); |
493 WaitForPrefChange(pref_service2.get(), kKey); | 493 WaitForPrefChange(pref_service2.get(), kKey); |
494 } | 494 } |
495 | 495 |
496 } // namespace | 496 } // namespace |
497 } // namespace prefs | 497 } // namespace prefs |
OLD | NEW |