OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/services/network/network_service_delegate.h" | 5 #include "mojo/services/network/network_service_delegate.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 observers_.AddObserver(observer); | 42 observers_.AddObserver(observer); |
43 } | 43 } |
44 | 44 |
45 void NetworkServiceDelegate::RemoveObserver( | 45 void NetworkServiceDelegate::RemoveObserver( |
46 NetworkServiceDelegateObserver* observer) { | 46 NetworkServiceDelegateObserver* observer) { |
47 observers_.RemoveObserver(observer); | 47 observers_.RemoveObserver(observer); |
48 } | 48 } |
49 | 49 |
50 void NetworkServiceDelegate::Initialize(Connector* connector, | 50 void NetworkServiceDelegate::Initialize(Connector* connector, |
51 const std::string& name, | 51 const std::string& name, |
52 uint32_t id, uint32_t user_id) { | 52 const std::string& user_id, |
| 53 uint32_t id) { |
53 // TODO(erg): Find everything else that writes to the filesystem and | 54 // TODO(erg): Find everything else that writes to the filesystem and |
54 // transition it to proxying mojo:filesystem. We shouldn't have any path | 55 // transition it to proxying mojo:filesystem. We shouldn't have any path |
55 // calculation code here, but sadly need it until the transition is done. In | 56 // calculation code here, but sadly need it until the transition is done. In |
56 // the mean time, manually handle the user-data-dir switch (which gets set in | 57 // the mean time, manually handle the user-data-dir switch (which gets set in |
57 // tests) so that tests are writing to a temp dir. | 58 // tests) so that tests are writing to a temp dir. |
58 base::FilePath base_path; | 59 base::FilePath base_path; |
59 const base::CommandLine* command_line = | 60 const base::CommandLine* command_line = |
60 base::CommandLine::ForCurrentProcess(); | 61 base::CommandLine::ForCurrentProcess(); |
61 if (command_line->HasSwitch(kUserDataDir)) { | 62 if (command_line->HasSwitch(kUserDataDir)) { |
62 base_path = command_line->GetSwitchValuePath(kUserDataDir); | 63 base_path = command_line->GetSwitchValuePath(kUserDataDir); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 107 } |
107 | 108 |
108 void NetworkServiceDelegate::Quit() { | 109 void NetworkServiceDelegate::Quit() { |
109 // Destroy the NetworkContext now as it requires MessageLoop::current() upon | 110 // Destroy the NetworkContext now as it requires MessageLoop::current() upon |
110 // destruction and it is the last moment we know for sure that it is | 111 // destruction and it is the last moment we know for sure that it is |
111 // running. | 112 // running. |
112 context_.reset(); | 113 context_.reset(); |
113 } | 114 } |
114 | 115 |
115 } // namespace mojo | 116 } // namespace mojo |
OLD | NEW |