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

Unified Diff: content/browser/net/url_request_mock_http_job.h

Issue 6973052: When the download folder does not exist, change the download folder to a user's "Downloads" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added URLRequestMockHTTPJob.test_dir_ and URLRequestMockHTTPJob.temp_dir_ Created 9 years, 5 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: content/browser/net/url_request_mock_http_job.h
diff --git a/content/browser/net/url_request_mock_http_job.h b/content/browser/net/url_request_mock_http_job.h
index 8c6b5fbfa13de4b53d789957ebbfa390f390c6cf..209e356ea1b392f43d3ea442244f78be1393a360 100644
--- a/content/browser/net/url_request_mock_http_job.h
+++ b/content/browser/net/url_request_mock_http_job.h
@@ -24,14 +24,23 @@ class URLRequestMockHTTPJob : public net::URLRequestFileJob {
virtual bool IsRedirectResponse(GURL* location, int* http_status_code);
static net::URLRequest::ProtocolFactory Factory;
+ static net::URLRequest::ProtocolFactory FactoryForMockUrlOfTempDir;
eroman 2011/08/04 20:09:44 Our style disallows non-POD static initializers. L
haraken1 2011/08/08 06:18:53 Done.
- // Adds the testing URLs to the net::URLRequestFilter.
- static void AddUrlHandler(const FilePath& base_path);
+ // Adds URLs for the DIR_TEST_DATA directory to the net::URLRequestFilter.
+ static void AddUrlHandler(const FilePath& test_dir);
- // Given the path to a file relative to base_path_, construct a mock URL.
+ // Adds URLs for the temporary directory to the net::URLRequestFilter.
+ static void AddUrlOfTempDirHandler(const FilePath& temp_dir);
+
+ // Given the path to a file relative to the DIR_TEST_DATA directory,
+ // construct a mock URL.
static GURL GetMockUrl(const FilePath& path);
- // Given the path to a file relative to base_path_,
+ // Given the path to a file relative to the temporary directory,
+ // construct a mock URL.
+ static GURL GetMockUrlOfTempDir(const FilePath& path);
+
+ // Given the path to a file relative to test_dir_ or temp_dir_,
// construct a mock URL for view source.
static GURL GetMockViewSourceUrl(const FilePath& path);
@@ -45,9 +54,13 @@ class URLRequestMockHTTPJob : public net::URLRequestFileJob {
private:
void GetResponseInfoConst(net::HttpResponseInfo* info) const;
- // This is the file path leading to the root of the directory to use as the
- // root of the http server.
- static FilePath base_path_;
+ // The DIR_TEST_DATA directory. This is used as the root directory
+ // of the http server.
+ static FilePath test_dir_;
eroman 2011/08/04 20:09:44 See earlier comment --> no static initializers ple
haraken1 2011/08/08 06:18:53 Removed this variable.
+
+ // The temporary directory. This is used as the root directory
+ // of the http server.
+ static FilePath temp_dir_;
};
#endif // CONTENT_BROWSER_NET_URL_REQUEST_MOCK_HTTP_JOB_H_

Powered by Google App Engine
This is Rietveld 408576698