OLD | NEW |
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/debugger/devtools_http_handler_impl.h" | 5 #include "content/browser/debugger/devtools_http_handler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 base::StringPiece data = | 231 base::StringPiece data = |
232 content::GetContentClient()->GetDataResource( | 232 content::GetContentClient()->GetDataResource( |
233 resource_id, ui::SCALE_FACTOR_NONE); | 233 resource_id, ui::SCALE_FACTOR_NONE); |
234 server_->Send200(connection_id, | 234 server_->Send200(connection_id, |
235 data.as_string(), | 235 data.as_string(), |
236 GetMimeType(filename)); | 236 GetMimeType(filename)); |
237 } | 237 } |
238 return; | 238 return; |
239 } | 239 } |
240 std::string base_url = delegate_->GetFrontendResourcesBaseURL(); | 240 std::string base_url = delegate_->GetFrontendResourcesBaseURL(); |
241 request = new net::URLRequest(GURL(base_url + filename), this); | 241 request = new net::URLRequest(GURL(base_url + filename), |
| 242 this, |
| 243 request_context); |
242 } else if (info.path.find("/thumb/") == 0) { | 244 } else if (info.path.find("/thumb/") == 0) { |
243 request = new net::URLRequest(GURL("chrome:/" + info.path), this); | 245 request = new net::URLRequest(GURL("chrome:/" + info.path), |
| 246 this, |
| 247 request_context); |
244 } else { | 248 } else { |
245 server_->Send404(connection_id); | 249 server_->Send404(connection_id); |
246 return; | 250 return; |
247 } | 251 } |
248 | 252 |
249 Bind(request, connection_id); | 253 Bind(request, connection_id); |
250 request->set_context(request_context); | |
251 request->Start(); | 254 request->Start(); |
252 } | 255 } |
253 | 256 |
254 void DevToolsHttpHandlerImpl::OnWebSocketRequest( | 257 void DevToolsHttpHandlerImpl::OnWebSocketRequest( |
255 int connection_id, | 258 int connection_id, |
256 const net::HttpServerRequestInfo& request) { | 259 const net::HttpServerRequestInfo& request) { |
257 BrowserThread::PostTask( | 260 BrowserThread::PostTask( |
258 BrowserThread::UI, | 261 BrowserThread::UI, |
259 FROM_HERE, | 262 FROM_HERE, |
260 base::Bind( | 263 base::Bind( |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 void DevToolsHttpHandlerImpl::AcceptWebSocket( | 618 void DevToolsHttpHandlerImpl::AcceptWebSocket( |
616 int connection_id, | 619 int connection_id, |
617 const net::HttpServerRequestInfo& request) { | 620 const net::HttpServerRequestInfo& request) { |
618 BrowserThread::PostTask( | 621 BrowserThread::PostTask( |
619 BrowserThread::IO, FROM_HERE, | 622 BrowserThread::IO, FROM_HERE, |
620 base::Bind(&net::HttpServer::AcceptWebSocket, server_.get(), | 623 base::Bind(&net::HttpServer::AcceptWebSocket, server_.get(), |
621 connection_id, request)); | 624 connection_id, request)); |
622 } | 625 } |
623 | 626 |
624 } // namespace content | 627 } // namespace content |
OLD | NEW |