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

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: Fixing typo 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 ae0a0fbbdd2f7c64932d6d78a699b79e3c39de48..78f84289aaab53c035ebbb7ee31f9b73c9f13635 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -283,7 +283,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(
@@ -295,6 +296,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 {
@@ -525,6 +529,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 =
@@ -536,6 +541,10 @@ ExtensionProtocolHandler::MaybeCreateJob(
extensions::WebAccessibleResourcesInfo::IsResourceWebAccessible(
extension, resource_path))
send_cors_header = true;
+
+ follow_symlinks_anywhere =
+ (extension->creation_flags() & Extension::FOLLOW_SYMLINKS_ANYWHERE)
+ != 0;
}
std::string path = request->url().path();
@@ -617,7 +626,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