| 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/shell/browser/shell_devtools_frontend.h" | 5 #include "content/shell/browser/shell_devtools_frontend.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 GURL gurl(url); | 210 GURL gurl(url); |
| 211 if (!gurl.is_valid()) { | 211 if (!gurl.is_valid()) { |
| 212 base::DictionaryValue response; | 212 base::DictionaryValue response; |
| 213 response.SetInteger("statusCode", 404); | 213 response.SetInteger("statusCode", 404); |
| 214 SendMessageAck(request_id, &response); | 214 SendMessageAck(request_id, &response); |
| 215 return; | 215 return; |
| 216 } | 216 } |
| 217 | 217 |
| 218 net::URLFetcher* fetcher = | 218 net::URLFetcher* fetcher = |
| 219 net::URLFetcher::Create(gurl, net::URLFetcher::GET, this); | 219 net::URLFetcher::Create(gurl, net::URLFetcher::GET, this).release(); |
| 220 pending_requests_[fetcher] = request_id; | 220 pending_requests_[fetcher] = request_id; |
| 221 fetcher->SetRequestContext(web_contents()->GetBrowserContext()-> | 221 fetcher->SetRequestContext(web_contents()->GetBrowserContext()-> |
| 222 GetRequestContext()); | 222 GetRequestContext()); |
| 223 fetcher->SetExtraRequestHeaders(headers); | 223 fetcher->SetExtraRequestHeaders(headers); |
| 224 fetcher->SaveResponseWithWriter(scoped_ptr<net::URLFetcherResponseWriter>( | 224 fetcher->SaveResponseWithWriter(scoped_ptr<net::URLFetcherResponseWriter>( |
| 225 new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); | 225 new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); |
| 226 fetcher->Start(); | 226 fetcher->Start(); |
| 227 return; | 227 return; |
| 228 } else if (method == "getPreferences") { | 228 } else if (method == "getPreferences") { |
| 229 SendMessageAck(request_id, &preferences_); | 229 SendMessageAck(request_id, &preferences_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 CallClientFunction("DevToolsAPI.embedderMessageAck", | 330 CallClientFunction("DevToolsAPI.embedderMessageAck", |
| 331 &id_value, arg, nullptr); | 331 &id_value, arg, nullptr); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void ShellDevToolsFrontend::AgentHostClosed( | 334 void ShellDevToolsFrontend::AgentHostClosed( |
| 335 DevToolsAgentHost* agent_host, bool replaced) { | 335 DevToolsAgentHost* agent_host, bool replaced) { |
| 336 frontend_shell_->Close(); | 336 frontend_shell_->Close(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 } // namespace content | 339 } // namespace content |
| OLD | NEW |