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

Unified Diff: chrome/browser/chrome_to_mobile_service.h

Issue 10914136: Fix URLFetcher leaks in ChromeToMobileService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/chrome_to_mobile_service.h
diff --git a/chrome/browser/chrome_to_mobile_service.h b/chrome/browser/chrome_to_mobile_service.h
index 162180d7b5b0dd72d118245c8edfe56aadc1acf1..a282b5f85febaab3df39dad2225961b396dec0aa 100644
--- a/chrome/browser/chrome_to_mobile_service.h
+++ b/chrome/browser/chrome_to_mobile_service.h
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "base/file_path.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/string16.h"
#include "base/timer.h"
@@ -180,7 +181,8 @@ class ChromeToMobileService : public ProfileKeyedService,
const FilePath& path,
bool success);
- // Create a cloud print job submission request for a URL or snapshot.
+ // Create a cloud print job submission request for a URL or snapshot. Caller
+ // owns lifetime of request created.
net::URLFetcher* CreateRequest();
// Initialize cloud print URLFetcher requests.
@@ -230,6 +232,11 @@ class ChromeToMobileService : public ProfileKeyedService,
// A queue of tasks to perform after an access token is lazily initialized.
std::queue<base::Closure> task_queue_;
+ // Used to manage the lifetime of various URLFetchers.
+ scoped_ptr<net::URLFetcher> submit_url_;
+ scoped_ptr<net::URLFetcher> search_request_;
+ scoped_ptr<net::URLFetcher> submit_snapshot_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService);
};
« no previous file with comments | « no previous file | chrome/browser/chrome_to_mobile_service.cc » ('j') | chrome/browser/chrome_to_mobile_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698