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 14 matching lines...) Expand all Loading... | |
25 public: | 25 public: |
26 ChromeContentUtilityClient(); | 26 ChromeContentUtilityClient(); |
27 virtual ~ChromeContentUtilityClient(); | 27 virtual ~ChromeContentUtilityClient(); |
28 | 28 |
29 virtual void UtilityThreadStarted() OVERRIDE; | 29 virtual void UtilityThreadStarted() OVERRIDE; |
30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 30 virtual 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 void DecodeImage(const std::vector<unsigned char>& encoded_data); | 35 static SkBitmap DecodeImage(const std::vector<unsigned char>& encoded_data, |
36 bool shrink_to_fit); | |
37 static void DecodeImageAndSend(const std::vector<unsigned char>& encoded_data, | |
38 bool shrink_to_fit); | |
39 | |
40 static void set_max_message_size(int64_t max_message_size) { | |
Mr4D (OOO till 08-26)
2014/09/25 02:15:03
set_max_ipc_message_size_for_test(..)
Greg Levin
2014/09/25 18:51:06
Done.
| |
41 max_ipc_message_size_ = max_message_size; | |
42 } | |
36 | 43 |
37 private: | 44 private: |
38 // IPC message handlers. | 45 // IPC message handlers. |
39 void OnUnpackWebResource(const std::string& resource_data); | 46 void OnUnpackWebResource(const std::string& resource_data); |
40 void OnDecodeImage(const std::vector<unsigned char>& encoded_data); | 47 void OnDecodeImage(const std::vector<unsigned char>& encoded_data, |
48 bool shrink_to_fit); | |
41 void OnRobustJPEGDecodeImage( | 49 void OnRobustJPEGDecodeImage( |
42 const std::vector<unsigned char>& encoded_data); | 50 const std::vector<unsigned char>& encoded_data); |
43 | 51 |
44 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
45 void OnCreateZipFile(const base::FilePath& src_dir, | 53 void OnCreateZipFile(const base::FilePath& src_dir, |
46 const std::vector<base::FilePath>& src_relative_paths, | 54 const std::vector<base::FilePath>& src_relative_paths, |
47 const base::FileDescriptor& dest_fd); | 55 const base::FileDescriptor& dest_fd); |
48 #endif // defined(OS_CHROMEOS) | 56 #endif // defined(OS_CHROMEOS) |
49 | 57 |
50 void OnPatchFileBsdiff(const base::FilePath& input_file, | 58 void OnPatchFileBsdiff(const base::FilePath& input_file, |
(...skipping 12 matching lines...) Expand all Loading... | |
63 int64 total_size, | 71 int64 total_size, |
64 bool get_attached_images); | 72 bool get_attached_images); |
65 #endif | 73 #endif |
66 | 74 |
67 typedef ScopedVector<UtilityMessageHandler> Handlers; | 75 typedef ScopedVector<UtilityMessageHandler> Handlers; |
68 Handlers handlers_; | 76 Handlers handlers_; |
69 | 77 |
70 // Flag to enable whitelisting. | 78 // Flag to enable whitelisting. |
71 bool filter_messages_; | 79 bool filter_messages_; |
72 // A list of message_ids to filter. | 80 // A list of message_ids to filter. |
73 std::set<int> message_id_whitelist_; | 81 std::set<int> message_id_whitelist_; |
Mr4D (OOO till 08-26)
2014/09/25 02:15:03
The comment should be a line above and states some
Greg Levin
2014/09/25 18:51:06
Done.
| |
82 static int64_t max_ipc_message_size_; // allowed to change for testing | |
74 | 83 |
75 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); | 84 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); |
76 }; | 85 }; |
77 | 86 |
78 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 87 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
OLD | NEW |