diff options
author | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-15 21:46:11 +0200 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-15 21:46:11 +0200 |
commit | 679147eead574d186ebf3069647b4c23e8ccace6 (patch) | |
tree | fc247a0ac8ff119f7c8550879ebb6d3dd8d1ff69 /chromium/content/public/browser/url_data_source.cc | |
download | qtwebengine-chromium-679147eead574d186ebf3069647b4c23e8ccace6.tar.gz |
Initial import.
Diffstat (limited to 'chromium/content/public/browser/url_data_source.cc')
-rw-r--r-- | chromium/content/public/browser/url_data_source.cc | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/chromium/content/public/browser/url_data_source.cc b/chromium/content/public/browser/url_data_source.cc new file mode 100644 index 00000000000..669f5c87262 --- /dev/null +++ b/chromium/content/public/browser/url_data_source.cc @@ -0,0 +1,55 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/public/browser/url_data_source.h" + +#include "content/browser/webui/url_data_manager.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/common/url_constants.h" +#include "net/url_request/url_request.h" + +namespace content { + +void URLDataSource::Add(BrowserContext* browser_context, + URLDataSource* source) { + URLDataManager::AddDataSource(browser_context, source); +} + +base::MessageLoop* URLDataSource::MessageLoopForRequestPath( + const std::string& path) const { + return BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::UI); +} + +bool URLDataSource::ShouldReplaceExistingSource() const { + return true; +} + +bool URLDataSource::AllowCaching() const { + return true; +} + +bool URLDataSource::ShouldAddContentSecurityPolicy() const { + return true; +} + +std::string URLDataSource::GetContentSecurityPolicyObjectSrc() const { + return "object-src 'none';"; +} + +std::string URLDataSource::GetContentSecurityPolicyFrameSrc() const { + return "frame-src 'none';"; +} + +bool URLDataSource::ShouldDenyXFrameOptions() const { + return true; +} + +bool URLDataSource::ShouldServiceRequest(const net::URLRequest* request) const { + if (request->url().SchemeIs(chrome::kChromeDevToolsScheme) || + request->url().SchemeIs(chrome::kChromeUIScheme)) + return true; + return false; +} + +} // namespace content |