diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index c8b923977d38..17ff9b2269cf 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -72,9 +72,13 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(content::Prot } base::FilePath BrowserContext::GetPath() { + if (!path_.empty()) + return path_; + base::FilePath path; CHECK(PathService::Get(base::DIR_APP_DATA, &path)); - return path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName())); + path_ = path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName())); + return path_; } bool BrowserContext::IsOffTheRecord() const { diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 47feccd042cf..a83e016e437e 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -46,6 +46,7 @@ private: virtual content::SpeechRecognitionPreferences* GetSpeechRecognitionPreferences() OVERRIDE; virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; + base::FilePath path_; scoped_ptr resource_context_; scoped_refptr url_request_getter_; scoped_ptr prefs_;