Store the disk cache in an app-specific location

We deduce the name of the application from the CFBundleName of the .app bundle
and use a path based on that. Similar logic should be implementable for other
platforms.

Fixes #3.
This commit is contained in:
Adam Roben 2013-03-13 16:45:00 -04:00
parent 65dd011fa3
commit e1b5e5e1bf
5 changed files with 34 additions and 9 deletions

View file

@ -4,6 +4,8 @@
#include "browser_context.h"
#include "common/application_name.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "content/public/browser/browser_thread.h"
@ -53,10 +55,9 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(content::Prot
}
base::FilePath BrowserContext::GetPath() {
// FIXME: This should be an application-specific path.
base::FilePath path;
CHECK(PathService::Get(base::DIR_APP_DATA, &path));
return path.Append("Brightray");
return path.Append(GetApplicationName());
}
bool BrowserContext::IsOffTheRecord() const {