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

Unified Diff: content/common/webmessageportchannel_impl.h

Issue 16328003: Move a bunch of child-only code from content/common to content/child (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/webkitplatformsupport_impl.cc ('k') | content/common/webmessageportchannel_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/webmessageportchannel_impl.h
diff --git a/content/common/webmessageportchannel_impl.h b/content/common/webmessageportchannel_impl.h
deleted file mode 100644
index 2efd2b8ad20f809cc6d1ec13a6fe2591f14323fa..0000000000000000000000000000000000000000
--- a/content/common/webmessageportchannel_impl.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2012 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.
-
-#ifndef CONTENT_COMMON_WEBMESSAGEPORTCHANNEL_IMPL_H_
-#define CONTENT_COMMON_WEBMESSAGEPORTCHANNEL_IMPL_H_
-
-#include <queue>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/string16.h"
-#include "base/synchronization/lock.h"
-#include "ipc/ipc_listener.h"
-#include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
-
-namespace content {
-
-// This is thread safe.
-class WebMessagePortChannelImpl
- : public WebKit::WebMessagePortChannel,
- public IPC::Listener,
- public base::RefCountedThreadSafe<WebMessagePortChannelImpl> {
- public:
- WebMessagePortChannelImpl();
- WebMessagePortChannelImpl(int route_id, int message_port_id);
-
- // Queues received and incoming messages until there are no more in-flight
- // messages, then sends all of them to the browser process.
- void QueueMessages();
- int message_port_id() const { return message_port_id_; }
-
- private:
- friend class base::RefCountedThreadSafe<WebMessagePortChannelImpl>;
- virtual ~WebMessagePortChannelImpl();
-
- // WebMessagePortChannel implementation.
- virtual void setClient(WebKit::WebMessagePortChannelClient* client);
- virtual void destroy();
- virtual void entangle(WebKit::WebMessagePortChannel* channel);
- virtual void postMessage(const WebKit::WebString& message,
- WebKit::WebMessagePortChannelArray* channels);
- virtual bool tryGetMessage(WebKit::WebString* message,
- WebKit::WebMessagePortChannelArray& channels);
-
- void Init();
- void Entangle(scoped_refptr<WebMessagePortChannelImpl> channel);
- void Send(IPC::Message* message);
-
- // IPC::Listener implementation.
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
-
- void OnMessage(const string16& message,
- const std::vector<int>& sent_message_port_ids,
- const std::vector<int>& new_routing_ids);
- void OnMessagedQueued();
-
- struct Message {
- Message();
- ~Message();
-
- string16 message;
- std::vector<WebMessagePortChannelImpl*> ports;
- };
-
- typedef std::queue<Message> MessageQueue;
- MessageQueue message_queue_;
-
- WebKit::WebMessagePortChannelClient* client_;
- base::Lock lock_; // Locks access to above.
-
- int route_id_; // The routing id for this object.
- int message_port_id_; // A globally unique identifier for this message port.
-
- DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl);
-};
-
-} // namespace content
-
-#endif // CONTENT_COMMON_WEBMESSAGEPORTCHANNEL_IMPL_H_
« no previous file with comments | « content/common/webkitplatformsupport_impl.cc ('k') | content/common/webmessageportchannel_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698