diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/autofill_messages.cc | 1 | ||||
-rw-r--r-- | chrome/common/automation_messages.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_constants.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_constants.h | 8 | ||||
-rw-r--r-- | chrome/common/common_param_traits.cc | 20 | ||||
-rw-r--r-- | chrome/common/common_param_traits.h | 11 | ||||
-rw-r--r-- | chrome/common/common_param_traits_unittest.cc | 1 | ||||
-rw-r--r-- | chrome/common/dom_storage_messages.cc | 2 | ||||
-rw-r--r-- | chrome/common/net/socket_stream.h | 15 | ||||
-rw-r--r-- | chrome/common/plugin_messages.cc | 1 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 1 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 60 | ||||
-rw-r--r-- | chrome/common/socket_stream_dispatcher.cc | 36 | ||||
-rw-r--r-- | chrome/common/utility_messages.h | 1 |
14 files changed, 26 insertions, 135 deletions
diff --git a/chrome/common/autofill_messages.cc b/chrome/common/autofill_messages.cc index 80b43f3..1243f1f 100644 --- a/chrome/common/autofill_messages.cc +++ b/chrome/common/autofill_messages.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/common/common_param_traits.h" +#include "content/common/common_param_traits.h" #include "webkit/glue/form_data.h" #include "webkit/glue/form_field.h" #include "webkit/glue/password_form.h" diff --git a/chrome/common/automation_messages.cc b/chrome/common/automation_messages.cc index f5f1ccc..efa93a9 100644 --- a/chrome/common/automation_messages.cc +++ b/chrome/common/automation_messages.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/common/common_param_traits.h" + #define IPC_MESSAGE_IMPL #include "chrome/common/automation_messages.h" diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index 0cb0fca..43c36a4 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -118,8 +118,6 @@ const int kStatsMaxThreads = 32; const int kStatsMaxCounters = 3000; const size_t kMaxTitleChars = 4 * 1024; -const size_t kMaxURLChars = 2 * 1024 * 1024; -const size_t kMaxURLDisplayChars = 32 * 1024; // We don't enable record mode in the released product because users could // potentially be tricked into running a product in record mode without diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index 56be2f8..c94ac25 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -78,14 +78,6 @@ extern const int kStatsMaxCounters; // The maximum number of characters of the document's title that we're willing // to accept in the browser process. extern const size_t kMaxTitleChars; -// The maximum number of characters in the URL that we're willing to accept -// in the browser process. It is set low enough to avoid damage to the browser -// but high enough that a web site can abuse location.hash for a little storage. -// We have different values for "max accepted" and "max displayed" because -// a data: URI may be legitimately massive, but the full URI would kill all -// known operating systems if you dropped it into a UI control. -extern const size_t kMaxURLChars; -extern const size_t kMaxURLDisplayChars; extern const bool kRecordModeEnabled; diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc index 8189922..94c97c9 100644 --- a/chrome/common/common_param_traits.cc +++ b/chrome/common/common_param_traits.cc @@ -10,6 +10,7 @@ #include "chrome/common/geoposition.h" #include "chrome/common/thumbnail_score.h" #include "chrome/common/web_apps.h" +#include "content/common/common_param_traits.h" #include "googleurl/src/gurl.h" #include "net/base/host_port_pair.h" #include "net/base/upload_data.h" @@ -104,25 +105,6 @@ void ParamTraits<SkBitmap>::Log(const SkBitmap& p, std::string* l) { #endif // EXCLUDE_SKIA_DEPENDENCIES -void ParamTraits<GURL>::Write(Message* m, const GURL& p) { - m->WriteString(p.possibly_invalid_spec()); - // TODO(brettw) bug 684583: Add encoding for query params. -} - -bool ParamTraits<GURL>::Read(const Message* m, void** iter, GURL* p) { - std::string s; - if (!m->ReadString(iter, &s) || s.length() > chrome::kMaxURLChars) { - *p = GURL(); - return false; - } - *p = GURL(s); - return true; -} - -void ParamTraits<GURL>::Log(const GURL& p, std::string* l) { - l->append(p.spec()); -} - void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { m->WriteInt(p.x()); m->WriteInt(p.y()); diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 860dcc6..abeaa117 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -35,7 +35,6 @@ // Forward declarations. struct Geoposition; -class GURL; class SkBitmap; class DictionaryValue; class ListValue; @@ -78,16 +77,6 @@ struct ParamTraits<SkBitmap> { static void Log(const param_type& p, std::string* l); }; - -template <> -struct ParamTraits<GURL> { - typedef GURL 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); -}; - - template <> struct ParamTraits<gfx::Point> { typedef gfx::Point param_type; diff --git a/chrome/common/common_param_traits_unittest.cc b/chrome/common/common_param_traits_unittest.cc index 1dd62f6..186e68e 100644 --- a/chrome/common/common_param_traits_unittest.cc +++ b/chrome/common/common_param_traits_unittest.cc @@ -9,6 +9,7 @@ #include "base/values.h" #include "chrome/common/common_param_traits.h" #include "chrome/common/geoposition.h" +#include "content/common/common_param_traits.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_message.h" #include "ipc/ipc_message_utils.h" diff --git a/chrome/common/dom_storage_messages.cc b/chrome/common/dom_storage_messages.cc index 9aee345..3ee1f8d 100644 --- a/chrome/common/dom_storage_messages.cc +++ b/chrome/common/dom_storage_messages.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/common_param_traits.h" +#include "content/common/common_param_traits.h" #define IPC_MESSAGE_IMPL #include "chrome/common/dom_storage_messages.h" diff --git a/chrome/common/net/socket_stream.h b/chrome/common/net/socket_stream.h deleted file mode 100644 index 6999842..0000000 --- a/chrome/common/net/socket_stream.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2009 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 CHROME_COMMON_NET_SOCKET_STREAM_H_ -#define CHROME_COMMON_NET_SOCKET_STREAM_H_ -#pragma once - -namespace chrome_common_net { - -const int kNoSocketId = 0; - -} // namespace chrome_common_net - -#endif // CHROME_COMMON_NET_SOCKET_STREAM_H_ diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc index 26d2aec..fe09d04 100644 --- a/chrome/common/plugin_messages.cc +++ b/chrome/common/plugin_messages.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/utf_string_conversions.h" +#include "content/common/common_param_traits.h" #include "ipc/ipc_channel_handle.h" #define IPC_MESSAGE_IMPL diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index a102bd7..fa07f83 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -20,6 +20,7 @@ #include "chrome/common/translate_errors.h" #include "chrome/common/view_types.h" #include "chrome/common/webkit_param_traits.h" +#include "content/common/common_param_traits.h" #include "ipc/ipc_message_utils.h" #include "ipc/ipc_platform_file.h" // ifdefed typedef. #include "ui/base/clipboard/clipboard.h" // enum diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index ba6aa0b..2aabd92 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -917,33 +917,6 @@ IPC_MESSAGE_CONTROL1(ViewMsg_SetIPCLoggingEnabled, bool /* on or off */) #endif -// Socket Stream messages: -// These are messages from the browser to the SocketStreamHandle on -// a renderer. - -// A |socket_id| is assigned by ViewHostMsg_SocketStream_Connect. -// The Socket Stream is connected. The SocketStreamHandle should keep track -// of how much it has pending (how much it has requested to be sent) and -// shouldn't go over |max_pending_send_allowed| bytes. -IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_Connected, - int /* socket_id */, - int /* max_pending_send_allowed */) - -// |data| is received on the Socket Stream. -IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_ReceivedData, - int /* socket_id */, - std::vector<char> /* data */) - -// |amount_sent| bytes of data requested by -// ViewHostMsg_SocketStream_SendData has been sent on the Socket Stream. -IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_SentData, - int /* socket_id */, - int /* amount_sent */) - -// The Socket Stream is closed. -IPC_MESSAGE_CONTROL1(ViewMsg_SocketStream_Closed, - int /* socket_id */) - // SpellChecker messages. // Passes some initialization params to the renderer's spellchecker. This can @@ -2307,39 +2280,6 @@ IPC_MESSAGE_ROUTED4(ViewHostMsg_PageTranslated, TranslateErrors::Type /* the error type if available */) //--------------------------------------------------------------------------- -// Socket Stream messages: -// These are messages from the SocketStreamHandle to the browser. - -// Open new Socket Stream for the |socket_url| identified by |socket_id| -// in the renderer process. -// The browser starts connecting asynchronously. -// Once Socket Stream connection is established, the browser will send -// ViewMsg_SocketStream_Connected back. -IPC_MESSAGE_CONTROL2(ViewHostMsg_SocketStream_Connect, - GURL /* socket_url */, - int /* socket_id */) - -// Request to send data on the Socket Stream. -// SocketStreamHandle can send data at most |max_pending_send_allowed| bytes, -// which is given by ViewMsg_SocketStream_Connected at any time. -// The number of pending bytes can be tracked by size of |data| sent -// and |amount_sent| parameter of ViewMsg_SocketStream_DataSent. -// That is, the following constraints is applied: -// (accumulated total of |data|) - (accumulated total of |amount_sent|) -// <= |max_pending_send_allowed| -// If the SocketStreamHandle ever tries to exceed the -// |max_pending_send_allowed|, the connection will be closed. -IPC_MESSAGE_CONTROL2(ViewHostMsg_SocketStream_SendData, - int /* socket_id */, - std::vector<char> /* data */) - -// Request to close the Socket Stream. -// The browser will send ViewMsg_SocketStream_Closed back when the Socket -// Stream is completely closed. -IPC_MESSAGE_CONTROL1(ViewHostMsg_SocketStream_Close, - int /* socket_id */) - -//--------------------------------------------------------------------------- // Request for cryptographic operation messages: // These are messages from the renderer to the browser to perform a // cryptographic operation. diff --git a/chrome/common/socket_stream_dispatcher.cc b/chrome/common/socket_stream_dispatcher.cc index a7e484a..362c19b 100644 --- a/chrome/common/socket_stream_dispatcher.cc +++ b/chrome/common/socket_stream_dispatcher.cc @@ -11,10 +11,9 @@ #include "base/ref_counted.h" #include "base/task.h" #include "chrome/common/child_thread.h" -#include "chrome/common/render_messages.h" -#include "chrome/common/net/socket_stream.h" +#include "content/common/socket_stream.h" +#include "content/common/socket_stream_messages.h" #include "googleurl/src/gurl.h" -#include "ipc/ipc_message.h" #include "webkit/glue/websocketstreamhandle_bridge.h" #include "webkit/glue/websocketstreamhandle_delegate.h" @@ -27,7 +26,7 @@ class IPCWebSocketStreamHandleBridge ChildThread* child_thread, WebKit::WebSocketStreamHandle* handle, webkit_glue::WebSocketStreamHandleDelegate* delegate) - : socket_id_(chrome_common_net::kNoSocketId), + : socket_id_(content_common::kNoSocketId), child_thread_(child_thread), handle_(handle), delegate_(delegate) {} @@ -71,9 +70,9 @@ IPCWebSocketStreamHandleBridge* IPCWebSocketStreamHandleBridge::FromSocketId( IPCWebSocketStreamHandleBridge::~IPCWebSocketStreamHandleBridge() { DVLOG(1) << "IPCWebSocketStreamHandleBridge destructor socket_id=" << socket_id_; - if (socket_id_ != chrome_common_net::kNoSocketId) { - child_thread_->Send(new ViewHostMsg_Close(socket_id_)); - socket_id_ = chrome_common_net::kNoSocketId; + if (socket_id_ != content_common::kNoSocketId) { + child_thread_->Send(new SocketStreamHostMsg_Close(socket_id_)); + socket_id_ = content_common::kNoSocketId; } } @@ -90,7 +89,7 @@ bool IPCWebSocketStreamHandleBridge::Send( const std::vector<char>& data) { DVLOG(1) << "Send data.size=" << data.size(); if (child_thread_->Send( - new ViewHostMsg_SocketStream_SendData(socket_id_, data))) { + new SocketStreamHostMsg_SendData(socket_id_, data))) { if (delegate_) delegate_->WillSendData(handle_, &data[0], data.size()); return true; @@ -100,7 +99,7 @@ bool IPCWebSocketStreamHandleBridge::Send( void IPCWebSocketStreamHandleBridge::Close() { DVLOG(1) << "Close socket_id" << socket_id_; - child_thread_->Send(new ViewHostMsg_SocketStream_Close(socket_id_)); + child_thread_->Send(new SocketStreamHostMsg_Close(socket_id_)); } void IPCWebSocketStreamHandleBridge::OnConnected(int max_pending_send_allowed) { @@ -123,9 +122,9 @@ void IPCWebSocketStreamHandleBridge::OnReceivedData( void IPCWebSocketStreamHandleBridge::OnClosed() { DVLOG(1) << "IPCWebSocketStreamHandleBridge::OnClosed"; - if (socket_id_ != chrome_common_net::kNoSocketId) { + if (socket_id_ != content_common::kNoSocketId) { all_bridges.Remove(socket_id_); - socket_id_ = chrome_common_net::kNoSocketId; + socket_id_ = content_common::kNoSocketId; } if (delegate_) delegate_->DidClose(handle_); @@ -135,15 +134,14 @@ void IPCWebSocketStreamHandleBridge::OnClosed() { void IPCWebSocketStreamHandleBridge::DoConnect(const GURL& url) { DCHECK(child_thread_); - DCHECK_EQ(socket_id_, chrome_common_net::kNoSocketId); + DCHECK_EQ(socket_id_, content_common::kNoSocketId); if (delegate_) delegate_->WillOpenStream(handle_, url); socket_id_ = all_bridges.Add(this); - DCHECK_NE(socket_id_, chrome_common_net::kNoSocketId); + DCHECK_NE(socket_id_, content_common::kNoSocketId); AddRef(); // Released in OnClosed(). - if (child_thread_->Send( - new ViewHostMsg_SocketStream_Connect(url, socket_id_))) { + if (child_thread_->Send(new SocketStreamHostMsg_Connect(url, socket_id_))) { DVLOG(1) << "Connect socket_id=" << socket_id_; // TODO(ukai): timeout to OnConnected. } else { @@ -167,10 +165,10 @@ SocketStreamDispatcher::CreateBridge( bool SocketStreamDispatcher::OnMessageReceived(const IPC::Message& msg) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(SocketStreamDispatcher, msg) - IPC_MESSAGE_HANDLER(ViewMsg_SocketStream_Connected, OnConnected) - IPC_MESSAGE_HANDLER(ViewMsg_SocketStream_SentData, OnSentData) - IPC_MESSAGE_HANDLER(ViewMsg_SocketStream_ReceivedData, OnReceivedData) - IPC_MESSAGE_HANDLER(ViewMsg_SocketStream_Closed, OnClosed) + IPC_MESSAGE_HANDLER(SocketStreamMsg_Connected, OnConnected) + IPC_MESSAGE_HANDLER(SocketStreamMsg_SentData, OnSentData) + IPC_MESSAGE_HANDLER(SocketStreamMsg_ReceivedData, OnReceivedData) + IPC_MESSAGE_HANDLER(SocketStreamMsg_Closed, OnClosed) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; diff --git a/chrome/common/utility_messages.h b/chrome/common/utility_messages.h index 7d00790..c6382ce 100644 --- a/chrome/common/utility_messages.h +++ b/chrome/common/utility_messages.h @@ -16,6 +16,7 @@ #include "chrome/common/indexed_db_key.h" #include "chrome/common/indexed_db_param_traits.h" #include "chrome/common/serialized_script_value.h" +#include "content/common/common_param_traits.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_utils.h" #include "printing/backend/print_backend.h" |