Merge pull request #110 from aroben/devtools-security

Make devtools work when web security is enabled
This commit is contained in:
Cheng Zhao 2015-06-03 09:51:32 +08:00
commit 239ddea0ce

View file

@ -42,11 +42,12 @@ std::string GetMimeTypeForPath(const std::string& path) {
return "image/png";
} else if (EndsWith(filename, ".gif", false)) {
return "image/gif";
} else if (EndsWith(filename, ".svg", false)) {
return "image/svg+xml";
} else if (EndsWith(filename, ".manifest", false)) {
return "text/cache-manifest";
}
NOTREACHED();
return "text/plain";
return "text/html";
}
class BundledDataSource : public content::URLDataSource {
@ -86,6 +87,14 @@ class BundledDataSource : public content::URLDataSource {
return false;
}
virtual bool ShouldDenyXFrameOptions() const override {
return false;
}
virtual bool ShouldServeMimeTypeAsContentTypeHeader() const override {
return true;
}
private:
virtual ~BundledDataSource() {}
DISALLOW_COPY_AND_ASSIGN(BundledDataSource);