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

Unified Diff: chrome/browser/translate/translate_manager.h

Issue 7246010: Fixed a few valgrind tests by not assuming the UrlFetcher arrives with the same URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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/translate/translate_manager.h
===================================================================
--- chrome/browser/translate/translate_manager.h (revision 90030)
+++ chrome/browser/translate/translate_manager.h (working copy)
@@ -12,6 +12,7 @@
#include <vector>
#include "base/lazy_instance.h"
+#include "base/scoped_ptr.h"
#include "base/task.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/common/translate_errors.h"
@@ -45,6 +46,10 @@
// It will not retry more than kMaxRetryLanguageListFetch times.
void FetchLanguageListFromTranslateServer(PrefService* prefs);
+ // Allows caller to cleanup pending URLFetcher objects to make sure they
+ // get released in the appropriate thread... Mainly for tests.
+ void CleanupPendingUlrFetcher();
+
// Translates the page contents from |source_lang| to |target_lang|.
// The actual translation might be performed asynchronously if the translate
// script is not yet available.
@@ -189,11 +194,12 @@
// from the translate server.
int translate_script_expiration_delay_;
- // Whether the translate JS is currently being retrieved.
- bool translate_script_request_pending_;
+ // Set when the translate JS is currently being retrieved. NULL otherwise.
+ scoped_ptr<URLFetcher> translate_script_request_pending_;
- // Whether the list of languages is currently being retrieved.
- bool language_list_request_pending_;
+ // Set when the list of languages is currently being retrieved.
+ // NULL otherwise.
+ scoped_ptr<URLFetcher> language_list_request_pending_;
// The list of pending translate requests. Translate requests are queued when
// the translate script is not ready and has to be fetched from the translate

Powered by Google App Engine
This is Rietveld 408576698