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

Side by Side Diff: chrome/browser/search_engines/search_provider_install_data.cc

Issue 137833009: Fix use after free in SearchProviderInstallData GoogleURLObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 10 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 | 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) 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 #include "chrome/browser/search_engines/search_provider_install_data.h" 5 #include "chrome/browser/search_engines/search_provider_install_data.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 BrowserThread::PostTask( 139 BrowserThread::PostTask(
140 BrowserThread::IO, FROM_HERE, 140 BrowserThread::IO, FROM_HERE,
141 base::Bind(&GoogleURLChangeNotifier::OnChange, 141 base::Bind(&GoogleURLChangeNotifier::OnChange,
142 change_notifier_.get(), 142 change_notifier_.get(),
143 content::Details<GoogleURLTracker::UpdatedDetails>(details)-> 143 content::Details<GoogleURLTracker::UpdatedDetails>(details)->
144 second.spec())); 144 second.spec()));
145 } 145 }
146 146
147 void GoogleURLObserver::RenderProcessHostDestroyed( 147 void GoogleURLObserver::RenderProcessHostDestroyed(
148 content::RenderProcessHost* host) { 148 content::RenderProcessHost* host) {
149 host->RemoveObserver(this);
149 delete this; 150 delete this;
150 } 151 }
151 152
152 // Indicates if the two inputs have the same security origin. 153 // Indicates if the two inputs have the same security origin.
153 // |requested_origin| should only be a security origin (no path, etc.). 154 // |requested_origin| should only be a security origin (no path, etc.).
154 // It is ok if |template_url| is NULL. 155 // It is ok if |template_url| is NULL.
155 static bool IsSameOrigin(const GURL& requested_origin, 156 static bool IsSameOrigin(const GURL& requested_origin,
156 TemplateURL* template_url, 157 TemplateURL* template_url,
157 const SearchTermsData& search_terms_data) { 158 const SearchTermsData& search_terms_data) {
158 DCHECK(requested_origin == requested_origin.GetOrigin()); 159 DCHECK(requested_origin == requested_origin.GetOrigin());
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 304
304 std::for_each(closure_queue.begin(), 305 std::for_each(closure_queue.begin(),
305 closure_queue.end(), 306 closure_queue.end(),
306 std::mem_fun_ref(&base::Closure::Run)); 307 std::mem_fun_ref(&base::Closure::Run));
307 308
308 // Since we expect this request to be rare, clear out the information. This 309 // Since we expect this request to be rare, clear out the information. This
309 // also keeps the responses current as the search providers change. 310 // also keeps the responses current as the search providers change.
310 provider_map_.reset(); 311 provider_map_.reset();
311 SetDefault(NULL); 312 SetDefault(NULL);
312 } 313 }
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