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

Side by Side Diff: chrome/browser/image_decoder.h

Issue 1071453002: Fail all started requests if the utility process crashes or fails to start. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@racy-image-decoder
Patch Set: Maybe fix windows. Created 5 years, 7 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 unified diff | Download patch
OLDNEW
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_BROWSER_IMAGE_DECODER_H_ 5 #ifndef CHROME_BROWSER_IMAGE_DECODER_H_
6 #define CHROME_BROWSER_IMAGE_DECODER_H_ 6 #define CHROME_BROWSER_IMAGE_DECODER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 // Starts UtilityProcessHost in batch mode and starts |batch_mode_timer_|. 111 // Starts UtilityProcessHost in batch mode and starts |batch_mode_timer_|.
112 // If the utility process fails to start, the method resets 112 // If the utility process fails to start, the method resets
113 // |utility_process_host_| and returns. 113 // |utility_process_host_| and returns.
114 void StartBatchMode(); 114 void StartBatchMode();
115 115
116 // Stops batch mode if no requests have come in since 116 // Stops batch mode if no requests have come in since
117 // |kBatchModeTimeoutSeconds|. 117 // |kBatchModeTimeoutSeconds|.
118 void StopBatchMode(); 118 void StopBatchMode();
119 119
120 // Fails all outstanding requests.
121 void FailAllRequests();
122
120 // Overidden from UtilityProcessHostClient. 123 // Overidden from UtilityProcessHostClient.
124 void OnProcessCrashed(int exit_code) override;
125 void OnProcessLaunchFailed() override;
121 bool OnMessageReceived(const IPC::Message& message) override; 126 bool OnMessageReceived(const IPC::Message& message) override;
122 127
123 // IPC message handlers. 128 // IPC message handlers.
124 void OnDecodeImageSucceeded(const SkBitmap& decoded_image, int request_id); 129 void OnDecodeImageSucceeded(const SkBitmap& decoded_image, int request_id);
125 void OnDecodeImageFailed(int request_id); 130 void OnDecodeImageFailed(int request_id);
126 131
127 // For the ImageRequest identified by |request_id|, call its OnImageDecoded() 132 // For the ImageRequest identified by |request_id|, call its OnImageDecoded()
128 // or OnDecodeImageFailed() method on its task runner thread. 133 // or OnDecodeImageFailed() method on its task runner thread.
129 void RunOnImageDecoded(const SkBitmap& decoded_image, int request_id); 134 void RunOnImageDecoded(const SkBitmap& decoded_image, int request_id);
130 void RunOnDecodeImageFailed(int request_id); 135 void RunOnDecodeImageFailed(int request_id);
(...skipping 13 matching lines...) Expand all
144 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed. 149 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed.
145 base::RepeatingTimer<ImageDecoder> batch_mode_timer_; 150 base::RepeatingTimer<ImageDecoder> batch_mode_timer_;
146 151
147 // The time Start() was last called. 152 // The time Start() was last called.
148 base::TimeTicks last_request_; 153 base::TimeTicks last_request_;
149 154
150 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); 155 DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
151 }; 156 };
152 157
153 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ 158 #endif // CHROME_BROWSER_IMAGE_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/image_decoder.cc » ('j') | chrome/browser/image_decoder_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698