| 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 <stddef.h> |
| 6 #include <stdint.h> |
| 7 |
| 5 #include <algorithm> | 8 #include <algorithm> |
| 6 #include <utility> | 9 #include <utility> |
| 7 | 10 |
| 8 #include "base/bind.h" | 11 #include "base/bind.h" |
| 9 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 10 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 11 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
| 12 #include "base/location.h" | 15 #include "base/location.h" |
| 13 #include "base/logging.h" | 16 #include "base/logging.h" |
| 14 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 15 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
| 16 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 18 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
| 19 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
| 20 #include "base/values.h" | 23 #include "base/values.h" |
| 24 #include "build/build_config.h" |
| 21 #include "components/devtools_discovery/devtools_discovery_manager.h" | 25 #include "components/devtools_discovery/devtools_discovery_manager.h" |
| 22 #include "components/devtools_http_handler/devtools_http_handler.h" | 26 #include "components/devtools_http_handler/devtools_http_handler.h" |
| 23 #include "components/devtools_http_handler/devtools_http_handler_delegate.h" | 27 #include "components/devtools_http_handler/devtools_http_handler_delegate.h" |
| 24 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/devtools_agent_host.h" | 29 #include "content/public/browser/devtools_agent_host.h" |
| 26 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" | 30 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" |
| 27 #include "content/public/common/url_constants.h" | 31 #include "content/public/common/url_constants.h" |
| 28 #include "content/public/common/user_agent.h" | 32 #include "content/public/common/user_agent.h" |
| 29 #include "net/base/escape.h" | 33 #include "net/base/escape.h" |
| 30 #include "net/base/io_buffer.h" | 34 #include "net/base/io_buffer.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 const char kTargetDescriptionField[] = "description"; | 67 const char kTargetDescriptionField[] = "description"; |
| 64 const char kTargetUrlField[] = "url"; | 68 const char kTargetUrlField[] = "url"; |
| 65 const char kTargetThumbnailUrlField[] = "thumbnailUrl"; | 69 const char kTargetThumbnailUrlField[] = "thumbnailUrl"; |
| 66 const char kTargetFaviconUrlField[] = "faviconUrl"; | 70 const char kTargetFaviconUrlField[] = "faviconUrl"; |
| 67 const char kTargetWebSocketDebuggerUrlField[] = "webSocketDebuggerUrl"; | 71 const char kTargetWebSocketDebuggerUrlField[] = "webSocketDebuggerUrl"; |
| 68 const char kTargetDevtoolsFrontendUrlField[] = "devtoolsFrontendUrl"; | 72 const char kTargetDevtoolsFrontendUrlField[] = "devtoolsFrontendUrl"; |
| 69 | 73 |
| 70 // Maximum write buffer size of devtools http/websocket connections. | 74 // Maximum write buffer size of devtools http/websocket connections. |
| 71 // TODO(rmcilroy/pfieldman): Reduce this back to 100Mb when we have | 75 // TODO(rmcilroy/pfieldman): Reduce this back to 100Mb when we have |
| 72 // added back pressure on the TraceComplete message protocol - crbug.com/456845. | 76 // added back pressure on the TraceComplete message protocol - crbug.com/456845. |
| 73 const int32 kSendBufferSizeForDevTools = 256 * 1024 * 1024; // 256Mb | 77 const int32_t kSendBufferSizeForDevTools = 256 * 1024 * 1024; // 256Mb |
| 74 | 78 |
| 75 } // namespace | 79 } // namespace |
| 76 | 80 |
| 77 // ServerWrapper ------------------------------------------------------------- | 81 // ServerWrapper ------------------------------------------------------------- |
| 78 // All methods in this class are only called on handler thread. | 82 // All methods in this class are only called on handler thread. |
| 79 class ServerWrapper : net::HttpServer::Delegate { | 83 class ServerWrapper : net::HttpServer::Delegate { |
| 80 public: | 84 public: |
| 81 ServerWrapper(base::WeakPtr<DevToolsHttpHandler> handler, | 85 ServerWrapper(base::WeakPtr<DevToolsHttpHandler> handler, |
| 82 scoped_ptr<net::ServerSocket> socket, | 86 scoped_ptr<net::ServerSocket> socket, |
| 83 const base::FilePath& frontend_dir, | 87 const base::FilePath& frontend_dir, |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 id.c_str(), | 930 id.c_str(), |
| 927 host); | 931 host); |
| 928 dictionary->SetString( | 932 dictionary->SetString( |
| 929 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 933 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
| 930 } | 934 } |
| 931 | 935 |
| 932 return dictionary; | 936 return dictionary; |
| 933 } | 937 } |
| 934 | 938 |
| 935 } // namespace devtools_http_handler | 939 } // namespace devtools_http_handler |
| OLD | NEW |