Merge pull request #1849 from atom/remove-devtools-hack
Remove AtomResourceDispatcherHostDelegate
This commit is contained in:
commit
3ee054e316
6 changed files with 1 additions and 79 deletions
|
@ -8,7 +8,6 @@
|
||||||
#include "atom/browser/atom_browser_context.h"
|
#include "atom/browser/atom_browser_context.h"
|
||||||
#include "atom/browser/atom_browser_main_parts.h"
|
#include "atom/browser/atom_browser_main_parts.h"
|
||||||
#include "atom/browser/atom_quota_permission_context.h"
|
#include "atom/browser/atom_quota_permission_context.h"
|
||||||
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
|
|
||||||
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
|
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
|
||||||
#include "atom/browser/native_window.h"
|
#include "atom/browser/native_window.h"
|
||||||
#include "atom/browser/web_view_manager.h"
|
#include "atom/browser/web_view_manager.h"
|
||||||
|
@ -22,7 +21,6 @@
|
||||||
#include "content/public/browser/browser_ppapi_host.h"
|
#include "content/public/browser/browser_ppapi_host.h"
|
||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
#include "content/public/browser/resource_dispatcher_host.h"
|
|
||||||
#include "content/public/browser/site_instance.h"
|
#include "content/public/browser/site_instance.h"
|
||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
#include "content/public/common/web_preferences.h"
|
#include "content/public/common/web_preferences.h"
|
||||||
|
@ -83,12 +81,6 @@ content::AccessTokenStore* AtomBrowserClient::CreateAccessTokenStore() {
|
||||||
return new AtomAccessTokenStore;
|
return new AtomAccessTokenStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomBrowserClient::ResourceDispatcherHostCreated() {
|
|
||||||
resource_dispatcher_delegate_.reset(new AtomResourceDispatcherHostDelegate);
|
|
||||||
content::ResourceDispatcherHost::Get()->SetDelegate(
|
|
||||||
resource_dispatcher_delegate_.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AtomBrowserClient::OverrideWebkitPrefs(
|
void AtomBrowserClient::OverrideWebkitPrefs(
|
||||||
content::RenderViewHost* render_view_host,
|
content::RenderViewHost* render_view_host,
|
||||||
content::WebPreferences* prefs) {
|
content::WebPreferences* prefs) {
|
||||||
|
|
|
@ -15,8 +15,6 @@ class QuotaPermissionContext;
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
class AtomResourceDispatcherHostDelegate;
|
|
||||||
|
|
||||||
class AtomBrowserClient : public brightray::BrowserClient {
|
class AtomBrowserClient : public brightray::BrowserClient {
|
||||||
public:
|
public:
|
||||||
AtomBrowserClient();
|
AtomBrowserClient();
|
||||||
|
@ -31,7 +29,6 @@ class AtomBrowserClient : public brightray::BrowserClient {
|
||||||
content::SpeechRecognitionManagerDelegate*
|
content::SpeechRecognitionManagerDelegate*
|
||||||
CreateSpeechRecognitionManagerDelegate() override;
|
CreateSpeechRecognitionManagerDelegate() override;
|
||||||
content::AccessTokenStore* CreateAccessTokenStore() override;
|
content::AccessTokenStore* CreateAccessTokenStore() override;
|
||||||
void ResourceDispatcherHostCreated() override;
|
|
||||||
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
||||||
content::WebPreferences* prefs) override;
|
content::WebPreferences* prefs) override;
|
||||||
std::string GetApplicationLocale() override;
|
std::string GetApplicationLocale() override;
|
||||||
|
@ -49,8 +46,6 @@ class AtomBrowserClient : public brightray::BrowserClient {
|
||||||
brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
|
brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
|
||||||
const content::MainFunctionParams&) override;
|
const content::MainFunctionParams&) override;
|
||||||
|
|
||||||
scoped_ptr<AtomResourceDispatcherHostDelegate> resource_dispatcher_delegate_;
|
|
||||||
|
|
||||||
// The render process which would be swapped out soon.
|
// The render process which would be swapped out soon.
|
||||||
content::RenderProcessHost* dying_render_process_;
|
content::RenderProcessHost* dying_render_process_;
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
|
||||||
// Use of this source code is governed by the MIT license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "base/logging.h"
|
|
||||||
#include "content/public/browser/render_frame_host.h"
|
|
||||||
#include "content/public/browser/resource_request_info.h"
|
|
||||||
#include "net/http/http_response_headers.h"
|
|
||||||
#include "net/url_request/url_request.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void AtomResourceDispatcherHostDelegate::OnResponseStarted(
|
|
||||||
net::URLRequest* request,
|
|
||||||
content::ResourceContext* resource_context,
|
|
||||||
content::ResourceResponse* response,
|
|
||||||
IPC::Sender* sender) {
|
|
||||||
// Remove the "X-Frame-Options" from response headers for devtools.
|
|
||||||
if (request->url().SchemeIs("chrome-devtools")) {
|
|
||||||
net::HttpResponseHeaders* response_headers = request->response_headers();
|
|
||||||
if (response_headers && response_headers->HasHeader("x-frame-options"))
|
|
||||||
response_headers->RemoveHeader("x-frame-options");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace atom
|
|
|
@ -1,30 +0,0 @@
|
||||||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
|
||||||
// Use of this source code is governed by the MIT license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
|
|
||||||
#define ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
|
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
|
||||||
#include "content/public/browser/resource_dispatcher_host_delegate.h"
|
|
||||||
|
|
||||||
namespace atom {
|
|
||||||
|
|
||||||
class AtomResourceDispatcherHostDelegate
|
|
||||||
: public content::ResourceDispatcherHostDelegate {
|
|
||||||
public:
|
|
||||||
AtomResourceDispatcherHostDelegate();
|
|
||||||
|
|
||||||
// content::ResourceDispatcherHostDelegate:
|
|
||||||
void OnResponseStarted(net::URLRequest* request,
|
|
||||||
content::ResourceContext* resource_context,
|
|
||||||
content::ResourceResponse* response,
|
|
||||||
IPC::Sender* sender) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomResourceDispatcherHostDelegate);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace atom
|
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
|
|
|
@ -115,8 +115,6 @@
|
||||||
'atom/browser/atom_javascript_dialog_manager.h',
|
'atom/browser/atom_javascript_dialog_manager.h',
|
||||||
'atom/browser/atom_quota_permission_context.cc',
|
'atom/browser/atom_quota_permission_context.cc',
|
||||||
'atom/browser/atom_quota_permission_context.h',
|
'atom/browser/atom_quota_permission_context.h',
|
||||||
'atom/browser/atom_resource_dispatcher_host_delegate.cc',
|
|
||||||
'atom/browser/atom_resource_dispatcher_host_delegate.h',
|
|
||||||
'atom/browser/atom_speech_recognition_manager_delegate.cc',
|
'atom/browser/atom_speech_recognition_manager_delegate.cc',
|
||||||
'atom/browser/atom_speech_recognition_manager_delegate.h',
|
'atom/browser/atom_speech_recognition_manager_delegate.h',
|
||||||
'atom/browser/browser.cc',
|
'atom/browser/browser.cc',
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 7391c76630ad514ee8c9a7e0d5e7932b60f38ab1
|
Subproject commit 88f063c1b432f124ffe4eb9ca68ee4b76a5fdf02
|
Loading…
Add table
Reference in a new issue