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

Side by Side Diff: chrome_frame/urlmon_url_request.cc

Issue 3220001: Merge 57581 - Fix a crash when delegate_ goes away in ReadStream... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome_frame/urlmon_url_request.h" 5 #include "chrome_frame/urlmon_url_request.h"
6 6
7 #include <wininet.h> 7 #include <wininet.h>
8 #include <urlmon.h> 8 #include <urlmon.h>
9 9
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // response end notification to chrome. 213 // response end notification to chrome.
214 if (hr == S_FALSE) 214 if (hr == S_FALSE)
215 pending_data_.Release(); 215 pending_data_.Release();
216 } 216 }
217 217
218 bytes_copied = read_data.length(); 218 bytes_copied = read_data.length();
219 219
220 if (bytes_copied) { 220 if (bytes_copied) {
221 ++calling_delegate_; 221 ++calling_delegate_;
222 DCHECK(id() != -1); 222 DCHECK(id() != -1);
223 delegate_->OnReadComplete(id(), read_data); 223 // The delegate can go away in the middle of ReadStream
224 if (delegate_)
225 delegate_->OnReadComplete(id(), read_data);
224 --calling_delegate_; 226 --calling_delegate_;
225 } 227 }
226 } else { 228 } else {
227 DLOG(ERROR) << __FUNCTION__ << me() << "no delegate"; 229 DLOG(ERROR) << __FUNCTION__ << me() << "no delegate";
228 } 230 }
229 231
230 return bytes_copied; 232 return bytes_copied;
231 } 233 }
232 234
233 STDMETHODIMP UrlmonUrlRequest::OnStartBinding(DWORD reserved, 235 STDMETHODIMP UrlmonUrlRequest::OnStartBinding(DWORD reserved,
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 privacy_info_.privacy_records[UTF8ToWide(url)]; 1160 privacy_info_.privacy_records[UTF8ToWide(url)];
1159 1161
1160 privacy_entry.flags |= flags; 1162 privacy_entry.flags |= flags;
1161 privacy_entry.policy_ref = UTF8ToWide(policy_ref); 1163 privacy_entry.policy_ref = UTF8ToWide(policy_ref);
1162 1164
1163 if (fire_privacy_event && IsWindow(notification_window_)) { 1165 if (fire_privacy_event && IsWindow(notification_window_)) {
1164 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1, 1166 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1,
1165 0); 1167 0);
1166 } 1168 }
1167 } 1169 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698