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

Side by Side Diff: ppapi/proxy/host_dispatcher.cc

Issue 10544089: Implement the file chooser as a new resource "host" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 #include "ppapi/proxy/host_dispatcher.h" 5 #include "ppapi/proxy/host_dispatcher.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 "Line", IPC_MESSAGE_ID_LINE(msg.type())); 176 "Line", IPC_MESSAGE_ID_LINE(msg.type()));
177 // We only want to allow reentrancy when the most recent message from the 177 // We only want to allow reentrancy when the most recent message from the
178 // plugin was a scripting message. We save the old state of the flag on the 178 // plugin was a scripting message. We save the old state of the flag on the
179 // stack in case we're (we are the host) being reentered ourselves. The flag 179 // stack in case we're (we are the host) being reentered ourselves. The flag
180 // is set to false here for all messages, and then the scripting API will 180 // is set to false here for all messages, and then the scripting API will
181 // explicitly set it to true during processing of those messages that can be 181 // explicitly set it to true during processing of those messages that can be
182 // reentered. 182 // reentered.
183 BoolRestorer restorer(&allow_plugin_reentrancy_); 183 BoolRestorer restorer(&allow_plugin_reentrancy_);
184 allow_plugin_reentrancy_ = false; 184 allow_plugin_reentrancy_ = false;
185 185
186 for (size_t i = 0; i < filters_.size(); i++) {
187 if (filters_[i]->OnMessageReceived(msg))
188 return true;
189 }
190
186 bool handled = true; 191 bool handled = true;
187 IPC_BEGIN_MESSAGE_MAP(HostDispatcher, msg) 192 IPC_BEGIN_MESSAGE_MAP(HostDispatcher, msg)
188 IPC_MESSAGE_HANDLER(PpapiHostMsg_LogWithSource, OnHostMsgLogWithSource) 193 IPC_MESSAGE_HANDLER(PpapiHostMsg_LogWithSource, OnHostMsgLogWithSource)
189 IPC_MESSAGE_UNHANDLED(handled = false) 194 IPC_MESSAGE_UNHANDLED(handled = false)
190 IPC_END_MESSAGE_MAP() 195 IPC_END_MESSAGE_MAP()
191 196
192 if (handled) 197 if (handled)
193 return true; 198 return true;
194 return Dispatcher::OnMessageReceived(msg); 199 return Dispatcher::OnMessageReceived(msg);
195 } 200 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 260 }
256 } 261 }
257 262
258 ScopedModuleReference::~ScopedModuleReference() { 263 ScopedModuleReference::~ScopedModuleReference() {
259 if (dispatcher_) 264 if (dispatcher_)
260 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module()); 265 dispatcher_->ppb_proxy()->ReleaseModule(dispatcher_->pp_module());
261 } 266 }
262 267
263 } // namespace proxy 268 } // namespace proxy
264 } // namespace ppapi 269 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698