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 17 matching lines...) Expand all Loading... |
28 | 28 |
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 | 31 |
32 static void PreSandboxStartup(); | 32 static void PreSandboxStartup(); |
33 | 33 |
34 // Shared with extensions::ExtensionsHandler. | 34 // Shared with extensions::ExtensionsHandler. |
35 static SkBitmap DecodeImage(const std::vector<unsigned char>& encoded_data, | 35 static SkBitmap DecodeImage(const std::vector<unsigned char>& encoded_data, |
36 bool shrink_to_fit); | 36 bool shrink_to_fit); |
37 static void DecodeImageAndSend(const std::vector<unsigned char>& encoded_data, | 37 static void DecodeImageAndSend(const std::vector<unsigned char>& encoded_data, |
38 bool shrink_to_fit); | 38 bool shrink_to_fit, int id); |
39 | 39 |
40 static void set_max_ipc_message_size_for_test(int64_t max_message_size) { | 40 static void set_max_ipc_message_size_for_test(int64_t max_message_size) { |
41 max_ipc_message_size_ = max_message_size; | 41 max_ipc_message_size_ = max_message_size; |
42 } | 42 } |
43 | 43 |
44 private: | 44 private: |
45 // IPC message handlers. | 45 // IPC message handlers. |
46 void OnUnpackWebResource(const std::string& resource_data); | 46 void OnUnpackWebResource(const std::string& resource_data); |
47 void OnDecodeImage(const std::vector<unsigned char>& encoded_data, | 47 void OnDecodeImage(const std::vector<unsigned char>& encoded_data, |
48 bool shrink_to_fit); | 48 bool shrink_to_fit, int id); |
49 void OnRobustJPEGDecodeImage( | 49 void OnRobustJPEGDecodeImage( |
50 const std::vector<unsigned char>& encoded_data); | 50 const std::vector<unsigned char>& encoded_data, int id); |
51 | 51 |
52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
53 void OnCreateZipFile(const base::FilePath& src_dir, | 53 void OnCreateZipFile(const base::FilePath& src_dir, |
54 const std::vector<base::FilePath>& src_relative_paths, | 54 const std::vector<base::FilePath>& src_relative_paths, |
55 const base::FileDescriptor& dest_fd); | 55 const base::FileDescriptor& dest_fd); |
56 #endif // defined(OS_CHROMEOS) | 56 #endif // defined(OS_CHROMEOS) |
57 | 57 |
58 void OnParseJSON(const std::string& json); | 58 void OnParseJSON(const std::string& json); |
59 void OnPatchFileBsdiff(const base::FilePath& input_file, | 59 void OnPatchFileBsdiff(const base::FilePath& input_file, |
60 const base::FilePath& patch_file, | 60 const base::FilePath& patch_file, |
(...skipping 19 matching lines...) Expand all Loading... |
80 bool filter_messages_; | 80 bool filter_messages_; |
81 // A list of message_ids to filter. | 81 // A list of message_ids to filter. |
82 std::set<int> message_id_whitelist_; | 82 std::set<int> message_id_whitelist_; |
83 // Maximum IPC msg size (default to kMaximumMessageSize; override for testing) | 83 // Maximum IPC msg size (default to kMaximumMessageSize; override for testing) |
84 static int64_t max_ipc_message_size_; | 84 static int64_t max_ipc_message_size_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); | 86 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); |
87 }; | 87 }; |
88 | 88 |
89 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 89 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
OLD | NEW |