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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 1507023004: Harden the implementation of '--disable-web-security' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: exclude //content/shell Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 return false; 1645 return false;
1646 1646
1647 mark_child_process_activity_time(); 1647 mark_child_process_activity_time();
1648 if (msg.routing_id() == MSG_ROUTING_CONTROL) { 1648 if (msg.routing_id() == MSG_ROUTING_CONTROL) {
1649 // Dispatch control messages. 1649 // Dispatch control messages.
1650 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg) 1650 IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg)
1651 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest, 1651 IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest,
1652 OnShutdownRequest) 1652 OnShutdownRequest)
1653 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_SuddenTerminationChanged, 1653 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_SuddenTerminationChanged,
1654 SuddenTerminationChanged) 1654 SuddenTerminationChanged)
1655 IPC_MESSAGE_HANDLER(RenderProcessHostMsg_GetUniversalAccessDisposition,
1656 OnGetUniversalAccessDisposition);
1655 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction, 1657 IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction,
1656 OnUserMetricsRecordAction) 1658 OnUserMetricsRecordAction)
1657 IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML) 1659 IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML)
1658 IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK) 1660 IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK)
1659 #if defined(ENABLE_WEBRTC) 1661 #if defined(ENABLE_WEBRTC)
1660 IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer, 1662 IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer,
1661 OnRegisterAecDumpConsumer) 1663 OnRegisterAecDumpConsumer)
1662 IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer, 1664 IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer,
1663 OnUnregisterAecDumpConsumer) 1665 OnUnregisterAecDumpConsumer)
1664 #endif 1666 #endif
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 2382
2381 mojo_application_host_->WillDestroySoon(); 2383 mojo_application_host_->WillDestroySoon();
2382 2384
2383 Send(new ChildProcessMsg_Shutdown()); 2385 Send(new ChildProcessMsg_Shutdown());
2384 } 2386 }
2385 2387
2386 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) { 2388 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) {
2387 SetSuddenTerminationAllowed(enabled); 2389 SetSuddenTerminationAllowed(enabled);
2388 } 2390 }
2389 2391
2392 void RenderProcessHostImpl::OnGetUniversalAccessDisposition(
2393 bool* is_access_grantable) {
2394 DCHECK(is_access_grantable);
2395 *is_access_grantable = base::CommandLine::ForCurrentProcess()->HasSwitch(
2396 switches::kDisableWebSecurity);
2397 }
2398
2390 void RenderProcessHostImpl::UpdateProcessPriority() { 2399 void RenderProcessHostImpl::UpdateProcessPriority() {
2391 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) { 2400 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) {
2392 is_process_backgrounded_ = false; 2401 is_process_backgrounded_ = false;
2393 return; 2402 return;
2394 } 2403 }
2395 2404
2396 // We background a process as soon as it hosts no active audio streams and no 2405 // We background a process as soon as it hosts no active audio streams and no
2397 // visible widgets -- the callers must call this function whenever we 2406 // visible widgets -- the callers must call this function whenever we
2398 // transition in/out of those states. 2407 // transition in/out of those states.
2399 const bool should_background = 2408 const bool should_background =
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 void RenderProcessHostImpl::GetAudioOutputControllers( 2667 void RenderProcessHostImpl::GetAudioOutputControllers(
2659 const GetAudioOutputControllersCallback& callback) const { 2668 const GetAudioOutputControllersCallback& callback) const {
2660 audio_renderer_host()->GetOutputControllers(callback); 2669 audio_renderer_host()->GetOutputControllers(callback);
2661 } 2670 }
2662 2671
2663 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { 2672 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() {
2664 return bluetooth_dispatcher_host_.get(); 2673 return bluetooth_dispatcher_host_.get();
2665 } 2674 }
2666 2675
2667 } // namespace content 2676 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698