| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 base::StringPiece data = | 242 base::StringPiece data = |
| 243 content::GetContentClient()->GetDataResource( | 243 content::GetContentClient()->GetDataResource( |
| 244 resource_id, ui::SCALE_FACTOR_NONE); | 244 resource_id, ui::SCALE_FACTOR_NONE); |
| 245 server_->Send200(connection_id, | 245 server_->Send200(connection_id, |
| 246 data.as_string(), | 246 data.as_string(), |
| 247 GetMimeType(filename)); | 247 GetMimeType(filename)); |
| 248 } | 248 } |
| 249 return; | 249 return; |
| 250 } | 250 } |
| 251 std::string base_url = delegate_->GetFrontendResourcesBaseURL(); | 251 std::string base_url = delegate_->GetFrontendResourcesBaseURL(); |
| 252 request = new net::URLRequest(GURL(base_url + filename), | 252 request = request_context->CreateRequest(GURL(base_url + filename), this); |
| 253 this, | |
| 254 request_context); | |
| 255 } else if (info.path.find("/thumb/") == 0) { | 253 } else if (info.path.find("/thumb/") == 0) { |
| 256 request = new net::URLRequest(GURL("chrome:/" + info.path), | 254 request = request_context->CreateRequest( |
| 257 this, | 255 GURL("chrome:/" + info.path), this); |
| 258 request_context); | |
| 259 } else { | 256 } else { |
| 260 server_->Send404(connection_id); | 257 server_->Send404(connection_id); |
| 261 return; | 258 return; |
| 262 } | 259 } |
| 263 | 260 |
| 264 Bind(request, connection_id); | 261 Bind(request, connection_id); |
| 265 request->Start(); | 262 request->Start(); |
| 266 } | 263 } |
| 267 | 264 |
| 268 void DevToolsHttpHandlerImpl::OnWebSocketRequest( | 265 void DevToolsHttpHandlerImpl::OnWebSocketRequest( |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 void DevToolsHttpHandlerImpl::AcceptWebSocket( | 642 void DevToolsHttpHandlerImpl::AcceptWebSocket( |
| 646 int connection_id, | 643 int connection_id, |
| 647 const net::HttpServerRequestInfo& request) { | 644 const net::HttpServerRequestInfo& request) { |
| 648 BrowserThread::PostTask( | 645 BrowserThread::PostTask( |
| 649 BrowserThread::IO, FROM_HERE, | 646 BrowserThread::IO, FROM_HERE, |
| 650 base::Bind(&net::HttpServer::AcceptWebSocket, server_.get(), | 647 base::Bind(&net::HttpServer::AcceptWebSocket, server_.get(), |
| 651 connection_id, request)); | 648 connection_id, request)); |
| 652 } | 649 } |
| 653 | 650 |
| 654 } // namespace content | 651 } // namespace content |
| OLD | NEW |