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

Unified Diff: content/browser/renderer_host/java_bridge_channel_host.cc

Issue 8525016: Move Java Bridge files to new java/ subdirectory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/java_bridge_channel_host.cc
diff --git a/content/browser/renderer_host/java_bridge_channel_host.cc b/content/browser/renderer_host/java_bridge_channel_host.cc
deleted file mode 100644
index 34898abdc5569930396bcae58820a1adca06fe4b..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/java_bridge_channel_host.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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/browser/renderer_host/java_bridge_channel_host.h"
-
-#include "base/lazy_instance.h"
-#include "base/stringprintf.h"
-#include "base/synchronization/waitable_event.h"
-
-using base::WaitableEvent;
-
-namespace {
-struct WaitableEventLazyInstanceTraits
- : public base::DefaultLazyInstanceTraits<WaitableEvent> {
- static WaitableEvent* New(void* instance) {
- // Use placement new to initialize our instance in our preallocated space.
- // The parenthesis is very important here to force POD type initialization.
- return new (instance) WaitableEvent(false, false);
- }
-};
-base::LazyInstance<WaitableEvent, WaitableEventLazyInstanceTraits> dummy_event(
- base::LINKER_INITIALIZED);
-}
-
-JavaBridgeChannelHost* JavaBridgeChannelHost::GetJavaBridgeChannelHost(
- int renderer_id, base::MessageLoopProxy* ipc_message_loop) {
- std::string channel_name(StringPrintf("r%d.javabridge", renderer_id));
- // We don't use a shutdown event because the Java Bridge only sends messages
- // from renderer to browser, so we'll never be waiting for a sync IPC to
- // complete. So we use an event which is never signaled.
- return static_cast<JavaBridgeChannelHost*>(NPChannelBase::GetChannel(
- channel_name,
- IPC::Channel::MODE_SERVER,
- ClassFactory,
- ipc_message_loop,
- false,
- dummy_event.Pointer()));
-}
-
-int JavaBridgeChannelHost::GenerateRouteID() {
- static int last_id = 0;
- return ++last_id;
-}
-
-bool JavaBridgeChannelHost::Init(base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now,
- WaitableEvent* shutdown_event) {
- if (!NPChannelBase::Init(ipc_message_loop, create_pipe_now, shutdown_event)) {
- return false;
- }
-
- // Finish populating our ChannelHandle.
-#if defined(OS_POSIX)
- // Leave the auto-close property at its default value.
- channel_handle_.socket.fd = channel_->GetClientFileDescriptor();
-#endif
-
- return true;
-}
-
-bool JavaBridgeChannelHost::Send(IPC::Message* msg) {
- CHECK(!msg->is_sync() && msg->is_reply()) <<
- "Java Bridge only sends messages from renderer to browser.";
- return NPChannelBase::Send(msg);
-}
« no previous file with comments | « content/browser/renderer_host/java_bridge_channel_host.h ('k') | content/browser/renderer_host/java_bridge_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698