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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <set> | 11 #include <set> |
11 #include <string> | 12 #include <string> |
12 #include <vector> | 13 #include <vector> |
13 | 14 |
14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "content/public/utility/content_utility_client.h" | 19 #include "content/public/utility/content_utility_client.h" |
20 #include "ipc/ipc_platform_file.h" | 20 #include "ipc/ipc_platform_file.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class FilePath; | 23 class FilePath; |
24 struct FileDescriptor; | 24 struct FileDescriptor; |
25 } | 25 } |
26 | 26 |
27 class UtilityMessageHandler; | 27 class UtilityMessageHandler; |
28 | 28 |
29 class ChromeContentUtilityClient : public content::ContentUtilityClient { | 29 class ChromeContentUtilityClient : public content::ContentUtilityClient { |
30 public: | 30 public: |
31 ChromeContentUtilityClient(); | 31 ChromeContentUtilityClient(); |
32 ~ChromeContentUtilityClient() override; | 32 ~ChromeContentUtilityClient() override; |
33 | 33 |
34 void UtilityThreadStarted() override; | 34 void UtilityThreadStarted() override; |
35 bool OnMessageReceived(const IPC::Message& message) override; | 35 bool OnMessageReceived(const IPC::Message& message) override; |
36 void RegisterMojoServices(content::ServiceRegistry* registry) override; | 36 void RegisterMojoServices(content::ServiceRegistry* registry) override; |
37 | 37 |
38 void AddHandler(scoped_ptr<UtilityMessageHandler> handler); | 38 void AddHandler(std::unique_ptr<UtilityMessageHandler> handler); |
39 | 39 |
40 static void PreSandboxStartup(); | 40 static void PreSandboxStartup(); |
41 | 41 |
42 private: | 42 private: |
43 // IPC message handlers. | 43 // IPC message handlers. |
44 void OnUnpackWebResource(const std::string& resource_data); | 44 void OnUnpackWebResource(const std::string& resource_data); |
45 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
46 void OnCreateZipFile(const base::FilePath& src_dir, | 46 void OnCreateZipFile(const base::FilePath& src_dir, |
47 const std::vector<base::FilePath>& src_relative_paths, | 47 const std::vector<base::FilePath>& src_relative_paths, |
48 const base::FileDescriptor& dest_fd); | 48 const base::FileDescriptor& dest_fd); |
(...skipping 21 matching lines...) Expand all Loading... |
70 | 70 |
71 // Flag to enable whitelisting. | 71 // Flag to enable whitelisting. |
72 bool filter_messages_; | 72 bool filter_messages_; |
73 // A list of message_ids to filter. | 73 // A list of message_ids to filter. |
74 std::set<int> message_id_whitelist_; | 74 std::set<int> message_id_whitelist_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); | 76 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); |
77 }; | 77 }; |
78 | 78 |
79 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 79 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
OLD | NEW |