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

Unified Diff: content/browser/websockets/websocket_impl.cc

Issue 2201763002: Switch on use_new_wrapper_types mode for content/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from kinuko Created 4 years, 4 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/browser/websockets/websocket_impl.h ('k') | content/common/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/websockets/websocket_impl.cc
diff --git a/content/browser/websockets/websocket_impl.cc b/content/browser/websockets/websocket_impl.cc
index d391005036d46609ae97749b74dc22782a0e3a34..6e64a7ed1b7d034906c907c3bdd560b055bf8965 100644
--- a/content/browser/websockets/websocket_impl.cc
+++ b/content/browser/websockets/websocket_impl.cc
@@ -174,11 +174,10 @@ ChannelState WebSocketImpl::WebSocketEventHandler::OnDataFrame(
<< " type=" << type << " data is " << data.size() << " bytes";
// TODO(darin): Avoid this copy.
- mojo::Array<uint8_t> data_to_pass(data.size());
+ std::vector<uint8_t> data_to_pass(data.size());
std::copy(data.begin(), data.end(), data_to_pass.begin());
- impl_->client_->OnDataFrame(fin, OpCodeToMessageType(type),
- std::move(data_to_pass));
+ impl_->client_->OnDataFrame(fin, OpCodeToMessageType(type), data_to_pass);
return net::WebSocketEventInterface::CHANNEL_ALIVE;
}
@@ -374,16 +373,11 @@ void WebSocketImpl::GoAway() {
void WebSocketImpl::AddChannelRequest(
const GURL& socket_url,
- mojo::Array<mojo::String> requested_protocols_mojo,
+ const std::vector<std::string>& requested_protocols,
const url::Origin& origin,
const GURL& first_party_for_cookies,
- const mojo::String& user_agent_override,
+ const std::string& user_agent_override,
mojom::WebSocketClientPtr client) {
- // Convert to STL types.
- std::vector<std::string> requested_protocols(
- requested_protocols_mojo.begin(),
- requested_protocols_mojo.end());
-
DVLOG(3) << "WebSocketImpl::AddChannelRequest @"
<< reinterpret_cast<void*>(this)
<< " socket_url=\"" << socket_url << "\" requested_protocols=\""
@@ -420,8 +414,9 @@ void WebSocketImpl::AddChannelRequest(
}
}
-void WebSocketImpl::SendFrame(bool fin, mojom::WebSocketMessageType type,
- mojo::Array<uint8_t> data) {
+void WebSocketImpl::SendFrame(bool fin,
+ mojom::WebSocketMessageType type,
+ const std::vector<uint8_t>& data) {
DVLOG(3) << "WebSocketImpl::SendFrame @"
<< reinterpret_cast<void*>(this) << " fin=" << fin
<< " type=" << type << " data is " << data.size() << " bytes";
@@ -462,7 +457,7 @@ void WebSocketImpl::SendFlowControl(int64_t quota) {
}
void WebSocketImpl::StartClosingHandshake(uint16_t code,
- const mojo::String& reason) {
+ const std::string& reason) {
DVLOG(3) << "WebSocketImpl::StartClosingHandshake @"
<< reinterpret_cast<void*>(this)
<< " code=" << code << " reason=\"" << reason << "\"";
« no previous file with comments | « content/browser/websockets/websocket_impl.h ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698