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

Unified Diff: chrome/browser/chrome_to_mobile_service.cc

Issue 10970054: Check ChromeToMobileService OriginalURLs before handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check submit URL before handling as such, etc. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_to_mobile_service.cc
diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc
index b2237e02ff42fd31cb09342a2fa12cb1507e0a50..b6ab90d635338d531b188ea9f86e0bc384d22c61 100644
--- a/chrome/browser/chrome_to_mobile_service.cc
+++ b/chrome/browser/chrome_to_mobile_service.cc
@@ -337,10 +337,12 @@ void ChromeToMobileService::Shutdown() {
}
void ChromeToMobileService::OnURLFetchComplete(const net::URLFetcher* source) {
- if (source->GetURL() == GetSearchURL(cloud_print_url_))
+ if (source->GetOriginalURL() == GetSearchURL(cloud_print_url_))
HandleSearchResponse(source);
- else
+ else if (source->GetOriginalURL() == GetSubmitURL(cloud_print_url_))
HandleSubmitResponse(source);
+ else
+ NOTREACHED();
// Remove the URLFetcher from the ScopedVector; this deletes the URLFetcher.
for (ScopedVector<net::URLFetcher>::iterator it = url_fetchers_.begin();
@@ -590,7 +592,7 @@ void ChromeToMobileService::RequestDeviceSearch() {
void ChromeToMobileService::HandleSearchResponse(
const net::URLFetcher* source) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
- DCHECK_EQ(source->GetURL(), GetSearchURL(cloud_print_url_));
+ DCHECK_EQ(source->GetOriginalURL(), GetSearchURL(cloud_print_url_));
ListValue mobiles;
std::string data;
@@ -643,6 +645,8 @@ void ChromeToMobileService::HandleSearchResponse(
void ChromeToMobileService::HandleSubmitResponse(
const net::URLFetcher* source) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+ DCHECK_EQ(source->GetOriginalURL(), GetSubmitURL(cloud_print_url_));
+
// Get the success value from the cloud print server response data.
std::string data;
bool success = false;
« 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