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

Side by Side Diff: content/public/browser/browser_message_filter.h

Issue 1723473003: Remove limitation that renderer can't send sync IPCs to the UI thread in the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <utility> 10 #include <utility>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Can be called on any thread, after OnChannelConnected is called. 85 // Can be called on any thread, after OnChannelConnected is called.
86 base::ProcessHandle PeerHandle(); 86 base::ProcessHandle PeerHandle();
87 87
88 // Can be called on any thread, after OnChannelConnected is called. 88 // Can be called on any thread, after OnChannelConnected is called.
89 base::ProcessId peer_pid() const { return peer_process_.Pid(); } 89 base::ProcessId peer_pid() const { return peer_process_.Pid(); }
90 90
91 void set_peer_process_for_testing(base::Process peer_process) { 91 void set_peer_process_for_testing(base::Process peer_process) {
92 peer_process_ = std::move(peer_process); 92 peer_process_ = std::move(peer_process);
93 } 93 }
94 94
95 // Checks that the given message can be dispatched on the UI thread, depending
96 // on the platform. If not, returns false and an error ot the sender.
97 static bool CheckCanDispatchOnUI(const IPC::Message& message,
98 IPC::Sender* sender);
99
100 // Called by bad_message.h helpers if a message couldn't be deserialized. This 95 // Called by bad_message.h helpers if a message couldn't be deserialized. This
101 // kills the renderer. Can be called on any thread. This doesn't log the 96 // kills the renderer. Can be called on any thread. This doesn't log the
102 // error details to UMA, so use the bad_message.h for your module instead. 97 // error details to UMA, so use the bad_message.h for your module instead.
103 virtual void ShutdownForBadMessage(); 98 virtual void ShutdownForBadMessage();
104 99
105 const std::vector<uint32_t>& message_classes_to_filter() const { 100 const std::vector<uint32_t>& message_classes_to_filter() const {
106 return message_classes_to_filter_; 101 return message_classes_to_filter_;
107 } 102 }
108 103
109 protected: 104 protected:
(...skipping 27 matching lines...) Expand all
137 132
138 struct BrowserMessageFilterTraits { 133 struct BrowserMessageFilterTraits {
139 static void Destruct(const BrowserMessageFilter* filter) { 134 static void Destruct(const BrowserMessageFilter* filter) {
140 filter->OnDestruct(); 135 filter->OnDestruct();
141 } 136 }
142 }; 137 };
143 138
144 } // namespace content 139 } // namespace content
145 140
146 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ 141 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/browser/browser_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698