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

Side by Side Diff: content/plugin/plugin_channel.cc

Issue 671663002: Standardize usage of virtual/override/final in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « content/plugin/plugin_channel.h ('k') | content/plugin/plugin_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/plugin/plugin_channel.h" 5 #include "content/plugin/plugin_channel.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process_handle.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 FROM_HERE, modal_dialog_event_map_[render_view_id].event); 72 FROM_HERE, modal_dialog_event_map_[render_view_id].event);
73 modal_dialog_event_map_.erase(render_view_id); 73 modal_dialog_event_map_.erase(render_view_id);
74 } 74 }
75 75
76 bool Send(IPC::Message* message) { 76 bool Send(IPC::Message* message) {
77 // Need this function for the IPC_MESSAGE_HANDLER_DELAY_REPLY macro. 77 // Need this function for the IPC_MESSAGE_HANDLER_DELAY_REPLY macro.
78 return sender_->Send(message); 78 return sender_->Send(message);
79 } 79 }
80 80
81 // IPC::MessageFilter: 81 // IPC::MessageFilter:
82 virtual void OnFilterAdded(IPC::Sender* sender) override { 82 void OnFilterAdded(IPC::Sender* sender) override { sender_ = sender; }
83 sender_ = sender;
84 }
85 83
86 virtual bool OnMessageReceived(const IPC::Message& message) override { 84 bool OnMessageReceived(const IPC::Message& message) override {
87 IPC_BEGIN_MESSAGE_MAP(PluginChannel::MessageFilter, message) 85 IPC_BEGIN_MESSAGE_MAP(PluginChannel::MessageFilter, message)
88 IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginMsg_Init, OnInit) 86 IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginMsg_Init, OnInit)
89 IPC_MESSAGE_HANDLER(PluginMsg_SignalModalDialogEvent, 87 IPC_MESSAGE_HANDLER(PluginMsg_SignalModalDialogEvent,
90 OnSignalModalDialogEvent) 88 OnSignalModalDialogEvent)
91 IPC_MESSAGE_HANDLER(PluginMsg_ResetModalDialogEvent, 89 IPC_MESSAGE_HANDLER(PluginMsg_ResetModalDialogEvent,
92 OnResetModalDialogEvent) 90 OnResetModalDialogEvent)
93 IPC_END_MESSAGE_MAP() 91 IPC_END_MESSAGE_MAP()
94 return message.type() == PluginMsg_SignalModalDialogEvent::ID || 92 return message.type() == PluginMsg_SignalModalDialogEvent::ID ||
95 message.type() == PluginMsg_ResetModalDialogEvent::ID; 93 message.type() == PluginMsg_ResetModalDialogEvent::ID;
96 } 94 }
97 95
98 protected: 96 protected:
99 virtual ~MessageFilter() { 97 ~MessageFilter() override {
100 // Clean up in case of renderer crash. 98 // Clean up in case of renderer crash.
101 for (ModalDialogEventMap::iterator i = modal_dialog_event_map_.begin(); 99 for (ModalDialogEventMap::iterator i = modal_dialog_event_map_.begin();
102 i != modal_dialog_event_map_.end(); ++i) { 100 i != modal_dialog_event_map_.end(); ++i) {
103 delete i->second.event; 101 delete i->second.event;
104 } 102 }
105 } 103 }
106 104
107 private: 105 private:
108 void OnInit(const PluginMsg_Init_Params& params, IPC::Message* reply_msg) { 106 void OnInit(const PluginMsg_Init_Params& params, IPC::Message* reply_msg) {
109 base::AutoLock auto_lock(modal_dialog_event_map_lock_); 107 base::AutoLock auto_lock(modal_dialog_event_map_lock_);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 void PluginChannel::OnDidAbortLoading(int render_view_id) { 337 void PluginChannel::OnDidAbortLoading(int render_view_id) {
340 for (size_t i = 0; i < plugin_stubs_.size(); ++i) { 338 for (size_t i = 0; i < plugin_stubs_.size(); ++i) {
341 if (plugin_stubs_[i]->webplugin()->host_render_view_routing_id() == 339 if (plugin_stubs_[i]->webplugin()->host_render_view_routing_id() ==
342 render_view_id) { 340 render_view_id) {
343 plugin_stubs_[i]->delegate()->instance()->CloseStreams(); 341 plugin_stubs_[i]->delegate()->instance()->CloseStreams();
344 } 342 }
345 } 343 }
346 } 344 }
347 345
348 } // namespace content 346 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/plugin_channel.h ('k') | content/plugin/plugin_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698