Chromium Code Reviews| Index: components/policy/core/common/cloud/device_management_service.h |
| diff --git a/components/policy/core/common/cloud/device_management_service.h b/components/policy/core/common/cloud/device_management_service.h |
| index cbec90ffc21c950e5b7fe77584a54182a1a3f0ea..17d2abc81b5dc01db6d4abd87ceb8f8987ca5524 100644 |
| --- a/components/policy/core/common/cloud/device_management_service.h |
| +++ b/components/policy/core/common/cloud/device_management_service.h |
| @@ -19,6 +19,7 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/strings/string_split.h" |
| +#include "base/threading/thread_checker.h" |
| #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| #include "components/policy/policy_export.h" |
| #include "net/url_request/url_fetcher_delegate.h" |
| @@ -155,6 +156,10 @@ class POLICY_EXPORT DeviceManagementService : public net::URLFetcherDelegate { |
| // Gets the URL that the DMServer requests are sent to. |
| std::string GetServerUrl(); |
| + // Sets the retry delay to a shorter time to prevent browser tests from |
| + // timeouting. |
|
Andrew T Wilson (Slow)
2016/05/10 17:58:33
nit: "timing out" not "timeouting" :)
Marton Hunyady
2016/05/11 09:40:08
Done.
|
| + static void SetRetryDelayForTesting(long retryDelayMs); |
| + |
| private: |
| typedef std::map<const net::URLFetcher*, |
| DeviceManagementRequestJobImpl*> JobFetcherMap; |
| @@ -193,6 +198,11 @@ class POLICY_EXPORT DeviceManagementService : public net::URLFetcherDelegate { |
| // If it is not initialized, incoming requests are queued. |
| bool initialized_; |
| + // TaskRunner used to schedule retry attempts. |
| + const scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| + |
| + base::ThreadChecker thread_checker_; |
| + |
| // Used to create tasks to run |Initialize| delayed on the UI thread. |
| base::WeakPtrFactory<DeviceManagementService> weak_ptr_factory_; |