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

Side by Side Diff: content/browser/renderer_host/socket_stream_dispatcher_host.cc

Issue 425653002: content: ResourceType cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" 5 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/renderer_host/socket_stream_host.h" 10 #include "content/browser/renderer_host/socket_stream_host.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 DVLOG(2) << "SocketStreamDispatcherHost::OnSSLCertificateError socket_id=" 137 DVLOG(2) << "SocketStreamDispatcherHost::OnSSLCertificateError socket_id="
138 << socket_id; 138 << socket_id;
139 if (socket_id == kNoSocketId) { 139 if (socket_id == kNoSocketId) {
140 DVLOG(1) << "NoSocketId in OnSSLCertificateError"; 140 DVLOG(1) << "NoSocketId in OnSSLCertificateError";
141 return; 141 return;
142 } 142 }
143 SocketStreamHost* socket_stream_host = hosts_.Lookup(socket_id); 143 SocketStreamHost* socket_stream_host = hosts_.Lookup(socket_id);
144 DCHECK(socket_stream_host); 144 DCHECK(socket_stream_host);
145 GlobalRequestID request_id(-1, socket_id); 145 GlobalRequestID request_id(-1, socket_id);
146 SSLManager::OnSSLCertificateError( 146 SSLManager::OnSSLCertificateError(
147 weak_ptr_factory_.GetWeakPtr(), request_id, ResourceType::SUB_RESOURCE, 147 weak_ptr_factory_.GetWeakPtr(), request_id, RESOURCE_TYPE_SUB_RESOURCE,
148 socket->url(), render_process_id_, socket_stream_host->render_frame_id(), 148 socket->url(), render_process_id_, socket_stream_host->render_frame_id(),
149 ssl_info, fatal); 149 ssl_info, fatal);
150 } 150 }
151 151
152 bool SocketStreamDispatcherHost::CanGetCookies(net::SocketStream* socket, 152 bool SocketStreamDispatcherHost::CanGetCookies(net::SocketStream* socket,
153 const GURL& url) { 153 const GURL& url) {
154 int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket); 154 int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket);
155 if (socket_id == kNoSocketId) { 155 if (socket_id == kNoSocketId) {
156 return false; 156 return false;
157 } 157 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 SocketStreamHost* socket_stream_host = hosts_.Lookup(socket_id); 280 SocketStreamHost* socket_stream_host = hosts_.Lookup(socket_id);
281 DCHECK(socket_stream_host); 281 DCHECK(socket_stream_host);
282 delete socket_stream_host; 282 delete socket_stream_host;
283 hosts_.Remove(socket_id); 283 hosts_.Remove(socket_id);
284 if (!Send(new SocketStreamMsg_Closed(socket_id))) { 284 if (!Send(new SocketStreamMsg_Closed(socket_id))) {
285 DVLOG(1) << "SocketStreamMsg_Closed failed."; 285 DVLOG(1) << "SocketStreamMsg_Closed failed.";
286 } 286 }
287 } 287 }
288 288
289 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { 289 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() {
290 return request_context_callback_.Run(ResourceType::SUB_RESOURCE); 290 return request_context_callback_.Run(RESOURCE_TYPE_SUB_RESOURCE);
291 } 291 }
292 292
293 void SocketStreamDispatcherHost::Shutdown() { 293 void SocketStreamDispatcherHost::Shutdown() {
294 DCHECK_CURRENTLY_ON(BrowserThread::IO); 294 DCHECK_CURRENTLY_ON(BrowserThread::IO);
295 // TODO(ukai): Implement IDMap::RemoveAll(). 295 // TODO(ukai): Implement IDMap::RemoveAll().
296 for (IDMap<SocketStreamHost>::const_iterator iter(&hosts_); 296 for (IDMap<SocketStreamHost>::const_iterator iter(&hosts_);
297 !iter.IsAtEnd(); 297 !iter.IsAtEnd();
298 iter.Advance()) { 298 iter.Advance()) {
299 int socket_id = iter.GetCurrentKey(); 299 int socket_id = iter.GetCurrentKey();
300 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); 300 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue();
301 delete socket_stream_host; 301 delete socket_stream_host;
302 hosts_.Remove(socket_id); 302 hosts_.Remove(socket_id);
303 } 303 }
304 on_shutdown_ = true; 304 on_shutdown_ = true;
305 } 305 }
306 306
307 } // namespace content 307 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/socket_stream_dispatcher_host.h ('k') | content/browser/renderer_host/websocket_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698