OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/websockets/websocket_manager.h" | 5 #include "content/browser/websockets/websocket_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/numerics/safe_conversions.h" | 13 #include "base/numerics/safe_conversions.h" |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
17 #include "content/public/browser/render_process_host_observer.h" | 17 #include "content/public/browser/render_process_host_observer.h" |
18 #include "content/public/browser/storage_partition.h" | 18 #include "content/public/browser/storage_partition.h" |
19 #include "services/service_manager/public/cpp/interface_registry.h" | |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 | 21 |
23 namespace { | 22 namespace { |
24 | 23 |
25 const char kWebSocketManagerKeyName[] = "web_socket_manager"; | 24 const char kWebSocketManagerKeyName[] = "web_socket_manager"; |
26 | 25 |
27 // Max number of pending connections per WebSocketManager used for per-renderer | 26 // Max number of pending connections per WebSocketManager used for per-renderer |
28 // WebSocket throttling. | 27 // WebSocket throttling. |
29 const int kMaxPendingWebSocketConnections = 255; | 28 const int kMaxPendingWebSocketConnections = 255; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 235 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
237 if (!url_request_context_getter_->GetURLRequestContext()) { | 236 if (!url_request_context_getter_->GetURLRequestContext()) { |
238 context_destroyed_ = true; | 237 context_destroyed_ = true; |
239 url_request_context_getter_ = nullptr; | 238 url_request_context_getter_ = nullptr; |
240 return; | 239 return; |
241 } | 240 } |
242 url_request_context_getter_->AddObserver(this); | 241 url_request_context_getter_->AddObserver(this); |
243 } | 242 } |
244 | 243 |
245 } // namespace content | 244 } // namespace content |
OLD | NEW |