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

Unified Diff: chrome/browser/extensions/extension_protocols.cc

Issue 106533003: Allowing following of symlinks for script resources from extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_protocols.cc
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index 30a0cf26b4320ba45e792c84c3357b6d7c72fb80..668f274baa1aa00e66f3c33632e16a089bf601d8 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -284,7 +284,8 @@ class URLRequestExtensionJob : public net::URLRequestFileJob {
const base::FilePath& directory_path,
const base::FilePath& relative_path,
const std::string& content_security_policy,
- bool send_cors_header)
+ bool send_cors_header,
+ bool follow_symlinks_anywhere)
: net::URLRequestFileJob(
request, network_delegate, base::FilePath(),
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
@@ -296,6 +297,9 @@ class URLRequestExtensionJob : public net::URLRequestFileJob {
content_security_policy_(content_security_policy),
send_cors_header_(send_cors_header),
weak_factory_(this) {
+ if (follow_symlinks_anywhere) {
+ resource_.set_follow_symlinks_anywhere();
+ }
}
virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE {
@@ -526,6 +530,7 @@ ExtensionProtocolHandler::MaybeCreateJob(
std::string content_security_policy;
bool send_cors_header = false;
+ bool follow_symlinks_anywhere = false;
if (extension) {
std::string resource_path = request->url().path();
content_security_policy =
@@ -537,6 +542,8 @@ ExtensionProtocolHandler::MaybeCreateJob(
extensions::WebAccessibleResourcesInfo::IsResourceWebAccessible(
extension, resource_path))
send_cors_header = true;
+
+ follow_symlinks_anywhere = extension->creation_flags();
benwells 2013/12/09 23:22:15 What is this line for - is it meant to limit this
blois 2013/12/09 23:31:06 Eek. Correct. It should be doing the same as this
}
std::string path = request->url().path();
@@ -618,7 +625,8 @@ ExtensionProtocolHandler::MaybeCreateJob(
directory_path,
relative_path,
content_security_policy,
- send_cors_header);
+ send_cors_header,
+ follow_symlinks_anywhere);
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698