| Index: content/browser/net/url_request_slow_http_job.cc
|
| diff --git a/content/browser/net/url_request_slow_http_job.cc b/content/browser/net/url_request_slow_http_job.cc
|
| index 3f1a6b69f3817e973f5c578d0b27f38fda40c272..1c62e20493d08f0e704b1262795ba9d16b5a8b54 100644
|
| --- a/content/browser/net/url_request_slow_http_job.cc
|
| +++ b/content/browser/net/url_request_slow_http_job.cc
|
| @@ -10,23 +10,32 @@
|
|
|
| static const char kMockHostname[] = "mock.slow.http";
|
|
|
| -FilePath URLRequestSlowHTTPJob::base_path_;
|
| +namespace {
|
| +
|
| +// This is the file path leading to the root of the directory to use as the
|
| +// root of the http server. This returns a reference that can be assigned to.
|
| +FilePath& BasePath() {
|
| + CR_DEFINE_STATIC_LOCAL(FilePath, base_path, ());
|
| + return base_path;
|
| +}
|
| +
|
| +} // namespace
|
|
|
| // static
|
| const int URLRequestSlowHTTPJob::kDelayMs = 1000;
|
|
|
| using base::TimeDelta;
|
|
|
| -/* static */
|
| +// static
|
| net::URLRequestJob* URLRequestSlowHTTPJob::Factory(net::URLRequest* request,
|
| const std::string& scheme) {
|
| return new URLRequestSlowHTTPJob(request,
|
| - GetOnDiskPath(base_path_, request, scheme));
|
| + GetOnDiskPath(BasePath(), request, scheme));
|
| }
|
|
|
| -/* static */
|
| +// static
|
| void URLRequestSlowHTTPJob::AddUrlHandler(const FilePath& base_path) {
|
| - base_path_ = base_path;
|
| + BasePath() = base_path;
|
|
|
| // Add kMockHostname to net::URLRequestFilter.
|
| net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
|
|
|