| Index: content/browser/net/url_request_mock_http_job.cc
|
| diff --git a/content/browser/net/url_request_mock_http_job.cc b/content/browser/net/url_request_mock_http_job.cc
|
| index 4b22301440ec8288c2aeaada54e754b73b356935..74e56d619af179021dcd74ebeb6b74ab4cd01cd1 100644
|
| --- a/content/browser/net/url_request_mock_http_job.cc
|
| +++ b/content/browser/net/url_request_mock_http_job.cc
|
| @@ -14,22 +14,26 @@
|
| #include "net/http/http_response_headers.h"
|
| #include "net/url_request/url_request_filter.h"
|
|
|
| -static const char kMockHostname[] = "mock.http";
|
| -static const FilePath::CharType kMockHeaderFileSuffix[] =
|
| +const char kMockHostname[] = "mock.http";
|
| +const FilePath::CharType kMockHeaderFileSuffix[] =
|
| FILE_PATH_LITERAL(".mock-http-headers");
|
|
|
| -FilePath URLRequestMockHTTPJob::base_path_;
|
| +// static
|
| +FilePath& URLRequestMockHTTPJob::BasePath() {
|
| + CR_DEFINE_STATIC_LOCAL(FilePath, base_path, ());
|
| + return base_path;
|
| +}
|
|
|
| // static
|
| net::URLRequestJob* URLRequestMockHTTPJob::Factory(net::URLRequest* request,
|
| const std::string& scheme) {
|
| return new URLRequestMockHTTPJob(request,
|
| - GetOnDiskPath(base_path_, request, scheme));
|
| + GetOnDiskPath(BasePath(), request, scheme));
|
| }
|
|
|
| // static
|
| void URLRequestMockHTTPJob::AddUrlHandler(const FilePath& base_path) {
|
| - base_path_ = base_path;
|
| + BasePath() = base_path;
|
|
|
| // Add kMockHostname to net::URLRequestFilter.
|
| net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
|
| @@ -37,7 +41,7 @@ void URLRequestMockHTTPJob::AddUrlHandler(const FilePath& base_path) {
|
| URLRequestMockHTTPJob::Factory);
|
| }
|
|
|
| -/* static */
|
| +// static
|
| GURL URLRequestMockHTTPJob::GetMockUrl(const FilePath& path) {
|
| std::string url = "http://";
|
| url.append(kMockHostname);
|
| @@ -48,7 +52,7 @@ GURL URLRequestMockHTTPJob::GetMockUrl(const FilePath& path) {
|
| return GURL(url);
|
| }
|
|
|
| -/* static */
|
| +// static
|
| GURL URLRequestMockHTTPJob::GetMockViewSourceUrl(const FilePath& path) {
|
| std::string url = chrome::kViewSourceScheme;
|
| url.append(":");
|
| @@ -56,7 +60,7 @@ GURL URLRequestMockHTTPJob::GetMockViewSourceUrl(const FilePath& path) {
|
| return GURL(url);
|
| }
|
|
|
| -/* static */
|
| +// static
|
| FilePath URLRequestMockHTTPJob::GetOnDiskPath(const FilePath& base_path,
|
| net::URLRequest* request,
|
| const std::string& scheme) {
|
|
|