| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 5 #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| 6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "content/public/utility/content_utility_client.h" | 10 #include "content/public/utility/content_utility_client.h" |
| 11 | 11 |
| 12 class UtilityMessageHandler; | 12 class UtilityMessageHandler; |
| 13 | 13 |
| 14 class ChromeContentUtilityClient : public content::ContentUtilityClient { | 14 class ChromeContentUtilityClient : public content::ContentUtilityClient { |
| 15 public: | 15 public: |
| 16 ChromeContentUtilityClient(); | 16 ChromeContentUtilityClient(); |
| 17 ~ChromeContentUtilityClient() override; | 17 ~ChromeContentUtilityClient() override; |
| 18 | 18 |
| 19 // content::ContentUtilityClient: | 19 // content::ContentUtilityClient: |
| 20 void UtilityThreadStarted() override; | 20 void UtilityThreadStarted() override; |
| 21 bool OnMessageReceived(const IPC::Message& message) override; | 21 bool OnMessageReceived(const IPC::Message& message) override; |
| 22 void ExposeInterfacesToBrowser( | 22 void ExposeInterfacesToBrowser( |
| 23 service_manager::InterfaceRegistry* registry) override; | 23 service_manager::InterfaceRegistry* registry) override; |
| 24 void RegisterServices(StaticServiceMap* services) override; | |
| 25 | 24 |
| 26 static void PreSandboxStartup(); | 25 static void PreSandboxStartup(); |
| 27 | 26 |
| 28 private: | 27 private: |
| 29 // IPC message handlers. | 28 // IPC message handlers. |
| 30 typedef ScopedVector<UtilityMessageHandler> Handlers; | 29 typedef ScopedVector<UtilityMessageHandler> Handlers; |
| 31 Handlers handlers_; | 30 Handlers handlers_; |
| 32 | 31 |
| 33 // True if the utility process runs with elevated privileges. | 32 // True if the utility process runs with elevated privileges. |
| 34 bool utility_process_running_elevated_; | 33 bool utility_process_running_elevated_; |
| 35 | 34 |
| 36 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); | 35 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); |
| 37 }; | 36 }; |
| 38 | 37 |
| 39 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 38 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| OLD | NEW |