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

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

Issue 292443004: Remove IPC_BEGIN_MESSAGE_MAP_EX macro since r270839 made all bad IPCs kill their child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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 #include "content/browser/renderer_host/clipboard_message_filter.h" 5 #include "content/browser/renderer_host/clipboard_message_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (IPC_MESSAGE_CLASS(message) == ClipboardMsgStart) 70 if (IPC_MESSAGE_CLASS(message) == ClipboardMsgStart)
71 *thread = BrowserThread::UI; 71 *thread = BrowserThread::UI;
72 #endif 72 #endif
73 73
74 #if defined(OS_WIN) 74 #if defined(OS_WIN)
75 if (message.type() == ClipboardHostMsg_ReadImage::ID) 75 if (message.type() == ClipboardHostMsg_ReadImage::ID)
76 *thread = BrowserThread::FILE; 76 *thread = BrowserThread::FILE;
77 #endif 77 #endif
78 } 78 }
79 79
80 bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message, 80 bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message) {
81 bool* message_was_ok) {
82 bool handled = true; 81 bool handled = true;
83 IPC_BEGIN_MESSAGE_MAP_EX(ClipboardMessageFilter, message, *message_was_ok) 82 IPC_BEGIN_MESSAGE_MAP(ClipboardMessageFilter, message)
84 IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsAsync, OnWriteObjectsAsync) 83 IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsAsync, OnWriteObjectsAsync)
85 IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsSync, OnWriteObjectsSync) 84 IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsSync, OnWriteObjectsSync)
86 IPC_MESSAGE_HANDLER(ClipboardHostMsg_GetSequenceNumber, OnGetSequenceNumber) 85 IPC_MESSAGE_HANDLER(ClipboardHostMsg_GetSequenceNumber, OnGetSequenceNumber)
87 IPC_MESSAGE_HANDLER(ClipboardHostMsg_IsFormatAvailable, OnIsFormatAvailable) 86 IPC_MESSAGE_HANDLER(ClipboardHostMsg_IsFormatAvailable, OnIsFormatAvailable)
88 IPC_MESSAGE_HANDLER(ClipboardHostMsg_Clear, OnClear) 87 IPC_MESSAGE_HANDLER(ClipboardHostMsg_Clear, OnClear)
89 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadAvailableTypes, 88 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadAvailableTypes,
90 OnReadAvailableTypes) 89 OnReadAvailableTypes)
91 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadText, OnReadText) 90 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadText, OnReadText)
92 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadHTML, OnReadHTML) 91 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadHTML, OnReadHTML)
93 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadRTF, OnReadRTF) 92 IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadRTF, OnReadRTF)
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 288
290 // static 289 // static
291 ui::Clipboard* ClipboardMessageFilter::GetClipboard() { 290 ui::Clipboard* ClipboardMessageFilter::GetClipboard() {
292 // We have a static instance of the clipboard service for use by all message 291 // We have a static instance of the clipboard service for use by all message
293 // filters. This instance lives for the life of the browser processes. 292 // filters. This instance lives for the life of the browser processes.
294 static ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); 293 static ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
295 return clipboard; 294 return clipboard;
296 } 295 }
297 296
298 } // namespace content 297 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/clipboard_message_filter.h ('k') | content/browser/renderer_host/database_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698