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/devtools/devtools_http_handler_impl.h" | 5 #include "content/browser/devtools/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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 base::FilePath path = frontend_dir.AppendASCII(filename); | 424 base::FilePath path = frontend_dir.AppendASCII(filename); |
425 std::string data; | 425 std::string data; |
426 base::ReadFileToString(path, &data); | 426 base::ReadFileToString(path, &data); |
427 server_->Send200(connection_id, data, mime_type); | 427 server_->Send200(connection_id, data, mime_type); |
428 return; | 428 return; |
429 } | 429 } |
430 if (delegate_->BundlesFrontendResources()) { | 430 if (delegate_->BundlesFrontendResources()) { |
431 int resource_id = DevToolsHttpHandler::GetFrontendResourceId(filename); | 431 int resource_id = DevToolsHttpHandler::GetFrontendResourceId(filename); |
432 if (resource_id != -1) { | 432 if (resource_id != -1) { |
433 base::StringPiece data = GetContentClient()->GetDataResource( | 433 base::StringPiece data = GetContentClient()->GetDataResource( |
434 resource_id, ui::SCALE_FACTOR_NONE); | 434 resource_id, ui::SCALE_FACTOR_NONE); |
435 server_->Send200(connection_id, data.as_string(), mime_type); | 435 server_->Send200(connection_id, data.as_string(), mime_type); |
436 return; | 436 return; |
437 } | 437 } |
438 } | 438 } |
439 server_->Send404(connection_id); | 439 server_->Send404(connection_id); |
440 } | 440 } |
441 | 441 |
442 void DevToolsHttpHandlerImpl::OnWebSocketRequest( | 442 void DevToolsHttpHandlerImpl::OnWebSocketRequest( |
443 int connection_id, | 443 int connection_id, |
444 const net::HttpServerRequestInfo& request) { | 444 const net::HttpServerRequestInfo& request) { |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 id.c_str(), | 960 id.c_str(), |
961 host); | 961 host); |
962 dictionary->SetString( | 962 dictionary->SetString( |
963 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 963 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
964 } | 964 } |
965 | 965 |
966 return dictionary; | 966 return dictionary; |
967 } | 967 } |
968 | 968 |
969 } // namespace content | 969 } // namespace content |
OLD | NEW |