Index: content/common/set_ipc_fuzzing.cc |
=================================================================== |
--- content/common/set_ipc_fuzzing.cc (revision 0) |
+++ content/common/set_ipc_fuzzing.cc (revision 0) |
@@ -0,0 +1,32 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/common/set_ipc_fuzzing.h" |
+ |
+#if defined(OS_LINUX) |
+#include <dlfcn.h> |
+#endif |
+ |
+typedef IPC::SyncChannel::OutgoingMessageFilter *(*GetFuzzerFunction)(); |
+const char kFuzzLibraryName[] = "libipcfuzz.so"; |
+const char kFuzzEntryPointName[] = "GetFilter"; |
+ |
+void SetIPCFuzzing(IPC::SyncChannel *channel) { |
+ |
+#if defined(OS_LINUX) |
+ // Fuzz is currently linux-only feature |
+ void *fuzz_library = dlopen(kFuzzLibraryName, RTLD_LAZY); |
+ if (fuzz_library) { |
+ GetFuzzerFunction fuzz_entry_point = reinterpret_cast<GetFuzzerFunction>( |
+ dlsym(fuzz_library, kFuzzEntryPointName)); |
+ |
+ if (fuzz_entry_point) |
+ channel->set_outgoing_message_filter(fuzz_entry_point()); |
+ } |
+#endif // OS_LINUX |
+ |
+} |
+ |
+ |
+ |
Property changes on: content/common/set_ipc_fuzzing.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |