| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 void UtilityThreadStarted() override; | 29 void UtilityThreadStarted() override; |
| 30 bool OnMessageReceived(const IPC::Message& message) override; | 30 bool OnMessageReceived(const IPC::Message& message) override; |
| 31 void RegisterMojoServices(content::ServiceRegistry* registry) override; | 31 void RegisterMojoServices(content::ServiceRegistry* registry) override; |
| 32 | 32 |
| 33 static void PreSandboxStartup(); | 33 static void PreSandboxStartup(); |
| 34 | 34 |
| 35 // Shared with extensions::ExtensionsHandler. | 35 // Shared with extensions::ExtensionsHandler. |
| 36 static SkBitmap DecodeImage(const std::vector<unsigned char>& encoded_data, | 36 static SkBitmap DecodeImage(const std::vector<unsigned char>& encoded_data, |
| 37 bool shrink_to_fit); | 37 bool shrink_to_fit); |
| 38 static void DecodeImageAndSend(const std::vector<unsigned char>& encoded_data, | 38 static void DecodeImageAndSend(const std::vector<unsigned char>& encoded_data, |
| 39 bool shrink_to_fit); | 39 bool shrink_to_fit, |
| 40 int id); |
| 40 | 41 |
| 41 static void set_max_ipc_message_size_for_test(int64_t max_message_size) { | 42 static void set_max_ipc_message_size_for_test(int64_t max_message_size) { |
| 42 max_ipc_message_size_ = max_message_size; | 43 max_ipc_message_size_ = max_message_size; |
| 43 } | 44 } |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 // IPC message handlers. | 47 // IPC message handlers. |
| 47 void OnUnpackWebResource(const std::string& resource_data); | 48 void OnUnpackWebResource(const std::string& resource_data); |
| 48 void OnDecodeImage(const std::vector<unsigned char>& encoded_data, | 49 void OnDecodeImage(const std::vector<unsigned char>& encoded_data, |
| 49 bool shrink_to_fit); | 50 bool shrink_to_fit, |
| 50 void OnRobustJPEGDecodeImage( | 51 int id); |
| 51 const std::vector<unsigned char>& encoded_data); | 52 void OnRobustJPEGDecodeImage(const std::vector<unsigned char>& encoded_data, |
| 53 int id); |
| 52 | 54 |
| 53 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
| 54 void OnCreateZipFile(const base::FilePath& src_dir, | 56 void OnCreateZipFile(const base::FilePath& src_dir, |
| 55 const std::vector<base::FilePath>& src_relative_paths, | 57 const std::vector<base::FilePath>& src_relative_paths, |
| 56 const base::FileDescriptor& dest_fd); | 58 const base::FileDescriptor& dest_fd); |
| 57 #endif // defined(OS_CHROMEOS) | 59 #endif // defined(OS_CHROMEOS) |
| 58 | 60 |
| 59 #if defined(OS_ANDROID) && defined(USE_SECCOMP_BPF) | 61 #if defined(OS_ANDROID) && defined(USE_SECCOMP_BPF) |
| 60 void OnDetectSeccompSupport(); | 62 void OnDetectSeccompSupport(); |
| 61 #endif | 63 #endif |
| (...skipping 24 matching lines...) Expand all Loading... |
| 86 bool filter_messages_; | 88 bool filter_messages_; |
| 87 // A list of message_ids to filter. | 89 // A list of message_ids to filter. |
| 88 std::set<int> message_id_whitelist_; | 90 std::set<int> message_id_whitelist_; |
| 89 // Maximum IPC msg size (default to kMaximumMessageSize; override for testing) | 91 // Maximum IPC msg size (default to kMaximumMessageSize; override for testing) |
| 90 static int64_t max_ipc_message_size_; | 92 static int64_t max_ipc_message_size_; |
| 91 | 93 |
| 92 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); | 94 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); |
| 93 }; | 95 }; |
| 94 | 96 |
| 95 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 97 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| OLD | NEW |