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

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

Issue 9980016: Delete background tab IOSurfaces on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed auto-resize and fullscreen toggle Created 8 years, 7 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #if defined(OS_WIN) 10 #if defined(OS_WIN)
11 #include <objbase.h> // For CoInitialize/CoUninitialize. 11 #include <objbase.h> // For CoInitialize/CoUninitialize.
12 #endif 12 #endif
13 13
14 #include <algorithm> 14 #include <algorithm>
15 #include <limits> 15 #include <limits>
16 #include <vector> 16 #include <vector>
17 17
18 #if defined(OS_POSIX) 18 #if defined(OS_POSIX)
19 #include <utility> // for pair<> 19 #include <utility> // for pair<>
20 #endif 20 #endif
21 21
22 #include "base/base_switches.h" 22 #include "base/base_switches.h"
23 #include "base/bind.h" 23 #include "base/bind.h"
24 #include "base/bind_helpers.h" 24 #include "base/bind_helpers.h"
25 #include "base/callback.h" 25 #include "base/callback.h"
26 #include "base/command_line.h" 26 #include "base/command_line.h"
27 #include "base/debug/trace_event.h"
27 #include "base/lazy_instance.h" 28 #include "base/lazy_instance.h"
28 #include "base/logging.h" 29 #include "base/logging.h"
29 #include "base/metrics/field_trial.h" 30 #include "base/metrics/field_trial.h"
30 #include "base/metrics/histogram.h" 31 #include "base/metrics/histogram.h"
31 #include "base/path_service.h" 32 #include "base/path_service.h"
32 #include "base/platform_file.h" 33 #include "base/platform_file.h"
33 #include "base/process_util.h" 34 #include "base/process_util.h"
34 #include "base/rand_util.h" 35 #include "base/rand_util.h"
35 #include "base/stl_util.h" 36 #include "base/stl_util.h"
36 #include "base/string_util.h" 37 #include "base/string_util.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 551
551 void RenderProcessHostImpl::CancelResourceRequests(int render_widget_id) { 552 void RenderProcessHostImpl::CancelResourceRequests(int render_widget_id) {
552 widget_helper_->CancelResourceRequests(render_widget_id); 553 widget_helper_->CancelResourceRequests(render_widget_id);
553 } 554 }
554 555
555 void RenderProcessHostImpl::SimulateSwapOutACK( 556 void RenderProcessHostImpl::SimulateSwapOutACK(
556 const ViewMsg_SwapOut_Params& params) { 557 const ViewMsg_SwapOut_Params& params) {
557 widget_helper_->SimulateSwapOutACK(params); 558 widget_helper_->SimulateSwapOutACK(params);
558 } 559 }
559 560
560 bool RenderProcessHostImpl::WaitForUpdateMsg( 561 bool RenderProcessHostImpl::WaitForBackingStoreMsg(
561 int render_widget_id, 562 int render_widget_id,
562 const base::TimeDelta& max_delay, 563 const base::TimeDelta& max_delay,
563 IPC::Message* msg) { 564 IPC::Message* msg) {
564 // The post task to this thread with the process id could be in queue, and we 565 // The post task to this thread with the process id could be in queue, and we
565 // don't want to dispatch a message before then since it will need the handle. 566 // don't want to dispatch a message before then since it will need the handle.
566 if (child_process_launcher_.get() && child_process_launcher_->IsStarting()) 567 if (child_process_launcher_.get() && child_process_launcher_->IsStarting())
567 return false; 568 return false;
568 569
569 return widget_helper_->WaitForUpdateMsg(render_widget_id, max_delay, msg); 570 return widget_helper_->WaitForBackingStoreMsg(render_widget_id,
571 max_delay, msg);
570 } 572 }
571 573
572 void RenderProcessHostImpl::ReceivedBadMessage() { 574 void RenderProcessHostImpl::ReceivedBadMessage() {
573 if (run_renderer_in_process()) { 575 if (run_renderer_in_process()) {
574 // In single process mode it is better if we don't suicide but just 576 // In single process mode it is better if we don't suicide but just
575 // crash. 577 // crash.
576 CHECK(false); 578 CHECK(false);
577 } 579 }
578 NOTREACHED(); 580 NOTREACHED();
579 base::KillProcess(GetHandle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, 581 base::KillProcess(GetHandle(), content::RESULT_CODE_KILLED_BAD_MESSAGE,
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 // Dispatch incoming messages to the appropriate RenderView/WidgetHost. 918 // Dispatch incoming messages to the appropriate RenderView/WidgetHost.
917 RenderWidgetHost* rwh = render_widget_hosts_.Lookup(msg.routing_id()); 919 RenderWidgetHost* rwh = render_widget_hosts_.Lookup(msg.routing_id());
918 if (!rwh) { 920 if (!rwh) {
919 if (msg.is_sync()) { 921 if (msg.is_sync()) {
920 // The listener has gone away, so we must respond or else the caller will 922 // The listener has gone away, so we must respond or else the caller will
921 // hang waiting for a reply. 923 // hang waiting for a reply.
922 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg); 924 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg);
923 reply->set_reply_error(); 925 reply->set_reply_error();
924 Send(reply); 926 Send(reply);
925 } 927 }
928
929 // If this is a SwapBuffers, we need to ack it if we're not going to handle
930 // it so that the GPU process doesn't get stuck in unscheduled state.
931 bool msg_is_ok = true;
932 IPC_BEGIN_MESSAGE_MAP_EX(RenderProcessHostImpl, msg, msg_is_ok)
933 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped,
934 OnCompositorSurfaceBuffersSwappedNoHost)
935 IPC_END_MESSAGE_MAP_EX()
926 return true; 936 return true;
927 } 937 }
928 return RenderWidgetHostImpl::From(rwh)->OnMessageReceived(msg); 938 return RenderWidgetHostImpl::From(rwh)->OnMessageReceived(msg);
929 } 939 }
930 940
931 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) { 941 void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) {
932 #if defined(IPC_MESSAGE_LOG_ENABLED) 942 #if defined(IPC_MESSAGE_LOG_ENABLED)
933 Send(new ChildProcessMsg_SetIPCLoggingEnabled( 943 Send(new ChildProcessMsg_SetIPCLoggingEnabled(
934 IPC::Logging::GetInstance()->Enabled())); 944 IPC::Logging::GetInstance()->Enabled()));
935 #endif 945 #endif
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { 1344 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) {
1335 // Only honor the request if appropriate persmissions are granted. 1345 // Only honor the request if appropriate persmissions are granted.
1336 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), 1346 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(),
1337 path)) 1347 path))
1338 content::GetContentClient()->browser()->OpenItem(path); 1348 content::GetContentClient()->browser()->OpenItem(path);
1339 } 1349 }
1340 1350
1341 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { 1351 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) {
1342 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); 1352 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size);
1343 } 1353 }
1354
1355 void RenderProcessHostImpl::OnCompositorSurfaceBuffersSwappedNoHost(
1356 int32 surface_id,
1357 uint64 surface_handle,
1358 int32 route_id,
1359 int32 gpu_process_host_id) {
1360 TRACE_EVENT0("renderer_host",
1361 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost");
1362 RenderWidgetHostImpl::AcknowledgeSwapBuffers(route_id,
1363 gpu_process_host_id);
1364 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/renderer_host/render_widget_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698