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

Unified Diff: chrome/browser/image_decoder.h

Issue 11968044: Fix login visual hitch on chromebook (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add settings observer and using unnamed sequence thread Created 7 years, 11 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/browser/image_decoder.h
diff --git a/chrome/browser/image_decoder.h b/chrome/browser/image_decoder.h
index 24f4d89bad6070486eb3b985f6a22b52143744f3..b1c9f19598dc8998f47f6f135667c341d073cc61 100644
--- a/chrome/browser/image_decoder.h
+++ b/chrome/browser/image_decoder.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/utility_process_host_client.h"
@@ -42,9 +43,13 @@ class ImageDecoder : public content::UtilityProcessHostClient {
const std::string& image_data,
ImageCodec image_codec);
- // Starts image decoding.
+ // Starts image decoding on well-known threads.
void Start();
+ // Starts image decoding on a sequence worker thread with a sequence token
+ // |sequence_token|.
+ void Start(const base::SequencedWorkerPool::SequenceToken& sequence_token);
+
const std::vector<unsigned char>& get_image_data() const {
return image_data_;
}
@@ -58,6 +63,10 @@ class ImageDecoder : public content::UtilityProcessHostClient {
// Overidden from UtilityProcessHostClient:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ // True if on valid thread or named worker thread associated with
+ // |sequence_token_name_|.
+ bool CalledOnValidThreadOrWorkerThread();
+
// IPC message handlers.
void OnDecodeImageSucceeded(const SkBitmap& decoded_image);
void OnDecodeImageFailed();
@@ -69,6 +78,8 @@ class ImageDecoder : public content::UtilityProcessHostClient {
std::vector<unsigned char> image_data_;
const ImageCodec image_codec_;
content::BrowserThread::ID target_thread_id_;
+ base::SequencedWorkerPool::SequenceToken sequence_token_;
+ bool decode_on_sequence_worker_thread_;
DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698