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

Side by Side Diff: content/common/swapped_out_messages.cc

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Some cleanup Created 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "content/common/swapped_out_messages.h" 5 #include "content/common/swapped_out_messages.h"
6 6
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "content/public/common/content_client.h" 8 #include "content/public/common/content_client.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 bool SwappedOutMessages::CanSendWhileSwappedOut(const IPC::Message* msg) { 12 bool SwappedOutMessages::CanSendWhileSwappedOut(const IPC::Message* msg) {
13 // We filter out most IPC messages when swapped out. However, some are 13 // We filter out most IPC messages when swapped out. However, some are
14 // important (e.g., ACKs) for keeping the browser and renderer state 14 // important (e.g., ACKs) for keeping the browser and renderer state
15 // consistent in case we later return to the same renderer. 15 // consistent in case we later return to the same renderer.
16 switch (msg->type()) { 16 switch (msg->type()) {
17 // Handled by RenderWidget. 17 // Handled by RenderWidget.
18 case ViewHostMsg_HandleInputEvent_ACK::ID: 18 case ViewHostMsg_HandleInputEvent_ACK::ID:
19 case ViewHostMsg_PaintAtSize_ACK::ID: 19 case ViewHostMsg_PaintAtSize_ACK::ID:
20 case ViewHostMsg_UpdateRect::ID: 20 case ViewHostMsg_UpdateRect::ID:
21 // Handled by RenderView. 21 // Handled by RenderView.
22 case ViewHostMsg_RenderViewGone::ID: 22 case ViewHostMsg_RenderViewGone::ID:
23 case ViewHostMsg_ShouldClose_ACK::ID: 23 case ViewHostMsg_ShouldClose_ACK::ID:
24 case ViewHostMsg_SwapOut_ACK::ID: 24 case ViewHostMsg_SwapOut_ACK::ID:
25 case ViewHostMsg_ClosePage_ACK::ID: 25 case ViewHostMsg_ClosePage_ACK::ID:
26 // Handled by RenderProcessHost.
27 case ViewHostMsg_SendPostMessage::ID:
26 return true; 28 return true;
27 default: 29 default:
28 break; 30 break;
29 } 31 }
30 32
31 // Check with the embedder as well. 33 // Check with the embedder as well.
32 ContentClient* client = GetContentClient(); 34 ContentClient* client = GetContentClient();
33 return client->CanSendWhileSwappedOut(msg); 35 return client->CanSendWhileSwappedOut(msg);
34 } 36 }
35 37
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 default: 76 default:
75 break; 77 break;
76 } 78 }
77 79
78 // Check with the embedder as well. 80 // Check with the embedder as well.
79 ContentClient* client = GetContentClient(); 81 ContentClient* client = GetContentClient();
80 return client->CanHandleWhileSwappedOut(msg); 82 return client->CanHandleWhileSwappedOut(msg);
81 } 83 }
82 84
83 } // namespace content 85 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698