Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Unified Diff: chrome/utility/chrome_content_utility_client.h

Issue 482163002: Large wallpaper decoding in utility process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Customize & reduce max_msg_size for testing Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/utility/chrome_content_utility_client.h
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h
index e70106469d00a52775e65e8b875be8cb29ff97ea..a72de0a46bd083fd8145ebadfa6794bd0a45fe99 100644
--- a/chrome/utility/chrome_content_utility_client.h
+++ b/chrome/utility/chrome_content_utility_client.h
@@ -32,12 +32,20 @@ class ChromeContentUtilityClient : public content::ContentUtilityClient {
static void PreSandboxStartup();
// Shared with extensions::ExtensionsHandler.
- static void DecodeImage(const std::vector<unsigned char>& encoded_data);
+ static SkBitmap DecodeImage(const std::vector<unsigned char>& encoded_data,
+ bool shrink_to_fit);
+ static void DecodeImageAndSend(const std::vector<unsigned char>& encoded_data,
+ bool shrink_to_fit);
+
+ 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.
+ max_ipc_message_size_ = max_message_size;
+ }
private:
// IPC message handlers.
void OnUnpackWebResource(const std::string& resource_data);
- void OnDecodeImage(const std::vector<unsigned char>& encoded_data);
+ void OnDecodeImage(const std::vector<unsigned char>& encoded_data,
+ bool shrink_to_fit);
void OnRobustJPEGDecodeImage(
const std::vector<unsigned char>& encoded_data);
@@ -71,6 +79,7 @@ class ChromeContentUtilityClient : public content::ContentUtilityClient {
bool filter_messages_;
// A list of message_ids to filter.
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.
+ static int64_t max_ipc_message_size_; // allowed to change for testing
DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient);
};

Powered by Google App Engine
This is Rietveld 408576698