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

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: Rebase 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
« no previous file with comments | « no previous file | chrome/browser/image_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 11 matching lines...) Expand all
142 base::WeakPtr<content::UtilityProcessHost> utility_process_host_; 147 base::WeakPtr<content::UtilityProcessHost> utility_process_host_;
143 148
144 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed, 149 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed,
145 // unless a new decoding request resets the timer. 150 // unless a new decoding request resets the timer.
146 scoped_ptr<base::DelayTimer<ImageDecoder>> batch_mode_timer_; 151 scoped_ptr<base::DelayTimer<ImageDecoder>> batch_mode_timer_;
147 152
148 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); 153 DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
149 }; 154 };
150 155
151 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ 156 #endif // CHROME_BROWSER_IMAGE_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/image_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698