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"; return "image/png";
} else if (EndsWith(filename, ".gif", false)) { } else if (EndsWith(filename, ".gif", false)) {
return "image/gif"; return "image/gif";
} else if (EndsWith(filename, ".svg", false)) {
return "image/svg+xml";
} else if (EndsWith(filename, ".manifest", false)) { } else if (EndsWith(filename, ".manifest", false)) {
return "text/cache-manifest"; return "text/cache-manifest";
} }
NOTREACHED(); return "text/html";
return "text/plain";
} }
class BundledDataSource : public content::URLDataSource { class BundledDataSource : public content::URLDataSource {
@ -86,6 +87,14 @@ class BundledDataSource : public content::URLDataSource {
return false; return false;
} }
virtual bool ShouldDenyXFrameOptions() const override {
return false;
}
virtual bool ShouldServeMimeTypeAsContentTypeHeader() const override {
return true;
}
private: private:
virtual ~BundledDataSource() {} virtual ~BundledDataSource() {}
DISALLOW_COPY_AND_ASSIGN(BundledDataSource); DISALLOW_COPY_AND_ASSIGN(BundledDataSource);