diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 00:25:40 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-07 00:25:40 +0000 |
commit | 1b4209f4c56fbdb6fe72aca508e8aa1c534964d4 (patch) | |
tree | 4ada6319dde7c5a46d974cad0007e7332dff858f /chrome/common | |
parent | 047b4b5470ad1b7888c96c9314af78f41a87f387 (diff) | |
download | chromium_src-1b4209f4c56fbdb6fe72aca508e8aa1c534964d4.zip chromium_src-1b4209f4c56fbdb6fe72aca508e8aa1c534964d4.tar.gz chromium_src-1b4209f4c56fbdb6fe72aca508e8aa1c534964d4.tar.bz2 |
Private Pepper extension for Flapper to allow TCP connections to be made
(from inside the renderer sandbox).
(Only enabled on ChromeOS, since it opens a hole in the renderer. This should be
revisited, with controls tightened, once Flapper runs out of process.)
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/5098002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/DEPS | 1 | ||||
-rw-r--r-- | chrome/common/render_messages.cc | 33 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 10 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 21 |
4 files changed, 62 insertions, 3 deletions
diff --git a/chrome/common/DEPS b/chrome/common/DEPS index a4256b3..cd9bd3f 100644 --- a/chrome/common/DEPS +++ b/chrome/common/DEPS @@ -5,6 +5,7 @@ include_rules = [ "+libxml", "+media/audio", "+media/base", + "+ppapi/c", # For various types. "+remoting/client/plugin", "+sandbox/src", "+skia", diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index c865a68..2519c7f 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -17,6 +17,7 @@ #include "media/audio/audio_buffers_state.h" #include "net/base/upload_data.h" #include "net/http/http_response_headers.h" +#include "ppapi/c/private/ppb_flash.h" #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/appcache/appcache_interfaces.h" @@ -39,7 +40,6 @@ namespace IPC { - template<> struct ParamTraits<WebMenuItem::Type> { typedef WebMenuItem::Type param_type; @@ -1236,4 +1236,33 @@ void ParamTraits<speech_input::SpeechInputResultItem>::Log(const param_type& p, l->append(")"); } +void ParamTraits<PP_Flash_NetAddress>::Write(Message* m, const param_type& p) { + WriteParam(m, p.size); + m->WriteBytes(p.data, p.size); +} + +bool ParamTraits<PP_Flash_NetAddress>::Read(const Message* m, + void** iter, + param_type* p) { + uint16 size; + if (!ReadParam(m, iter, &size)) + return false; + if (size > sizeof(p->data)) + return false; + p->size = size; + + const char* data; + if (!m->ReadBytes(iter, &data, size)) + return false; + memcpy(p->data, data, size); + return true; +} + +void ParamTraits<PP_Flash_NetAddress>::Log(const param_type& p, + std::string* l) { + l->append("<PP_Flash_NetAddress ("); + LogParam(p.size, l); + l->append(" bytes)>"); +} + } // namespace IPC diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index e06a667..258734a 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -61,7 +61,6 @@ struct ResourceLoadTimingInfo; struct ResourceResponseInfo; struct WebAccessibility; struct WebCookie; -struct WebAccessibility; } namespace webkit { @@ -79,6 +78,7 @@ class SkBitmap; class URLPattern; struct ContextMenuParams; struct EditCommand; +struct PP_Flash_NetAddress; struct ResourceResponseHead; struct SyncLoadResult; struct RendererPreferences; @@ -552,6 +552,14 @@ struct ParamTraits<speech_input::SpeechInputResultItem> { static void Log(const param_type& p, std::string* l); }; +template <> +struct ParamTraits<PP_Flash_NetAddress> { + typedef PP_Flash_NetAddress param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; + } // namespace IPC #include "chrome/common/render_messages_internal.h" diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 999a72f..ce0851d 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -51,6 +51,7 @@ typedef std::map<std::string, std::string> SubstitutionMap; class Value; class GPUInfo; +struct PP_Flash_NetAddress; class SkBitmap; struct ThumbnailScore; class WebCursor; @@ -1075,6 +1076,13 @@ IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem, IPC_MESSAGE_CONTROL1(ViewMsg_SpeechInput_SetFeatureEnabled, bool /* enabled */) +// The response to ViewHostMsg_PepperConnectTcp(Address). +IPC_MESSAGE_ROUTED4(ViewMsg_PepperConnectTcpACK, + int /* request_id */, + IPC::PlatformFileForTransit /* socket */, + PP_Flash_NetAddress /* local_addr */, + PP_Flash_NetAddress /* remote_addr */) + //----------------------------------------------------------------------------- // TabContents messages // These are messages sent from the renderer to the browser process. @@ -2630,3 +2638,16 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_ScriptEvalResponse, // Updates the content restrictions, i.e. to disable print/copy. IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateContentRestrictions, int /* restrictions */) + +// Pepper-related messages ----------------------------------------------------- + +IPC_MESSAGE_CONTROL4(ViewHostMsg_PepperConnectTcp, + int /* routing_id */, + int /* request_id */, + std::string /* host */, + uint16 /* port */) + +IPC_MESSAGE_CONTROL3(ViewHostMsg_PepperConnectTcpAddress, + int /* routing_id */, + int /* request_id */, + PP_Flash_NetAddress /* addr */) |