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/renderer/devtools/devtools_agent.h" | 5 #include "content/renderer/devtools/devtools_agent.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... | |
28 #include "third_party/WebKit/public/platform/WebPoint.h" | 28 #include "third_party/WebKit/public/platform/WebPoint.h" |
29 #include "third_party/WebKit/public/platform/WebString.h" | 29 #include "third_party/WebKit/public/platform/WebString.h" |
30 #include "third_party/WebKit/public/web/WebDevToolsAgent.h" | 30 #include "third_party/WebKit/public/web/WebDevToolsAgent.h" |
31 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 31 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
32 | 32 |
33 using blink::WebDevToolsAgent; | 33 using blink::WebDevToolsAgent; |
34 using blink::WebDevToolsAgentClient; | 34 using blink::WebDevToolsAgentClient; |
35 using blink::WebLocalFrame; | 35 using blink::WebLocalFrame; |
36 using blink::WebPoint; | 36 using blink::WebPoint; |
37 using blink::WebString; | 37 using blink::WebString; |
38 using blink::WebVector; | |
38 | 39 |
39 using base::trace_event::TraceLog; | 40 using base::trace_event::TraceLog; |
40 | 41 |
41 namespace content { | 42 namespace content { |
42 | 43 |
43 namespace { | 44 namespace { |
44 | 45 |
45 const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; | 46 const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; |
46 const char kPageGetAppManifest[] = "Page.getAppManifest"; | 47 const char kPageGetAppManifest[] = "Page.getAppManifest"; |
47 | 48 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 } | 192 } |
192 | 193 |
193 void DevToolsAgent::disableTracing() { | 194 void DevToolsAgent::disableTracing() { |
194 TraceLog::GetInstance()->SetDisabled(); | 195 TraceLog::GetInstance()->SetDisabled(); |
195 } | 196 } |
196 | 197 |
197 void DevToolsAgent::setCPUThrottlingRate(double rate) { | 198 void DevToolsAgent::setCPUThrottlingRate(double rate) { |
198 cpu_throttler_->SetThrottlingRate(rate); | 199 cpu_throttler_->SetThrottlingRate(rate); |
199 } | 200 } |
200 | 201 |
202 void DevToolsAgent::showCertificateViewer( | |
203 const WebVector<WebString>& certificate) { | |
204 std::vector<std::string> cert_vector; | |
205 for (auto cert : certificate) | |
Ryan Sleevi
2016/09/03 00:02:51
STYLE nit: const auto& ? Do you really intend to b
jam
2016/09/03 01:42:39
That was an oversight, but now that code is gone a
| |
206 cert_vector.push_back(cert.latin1()); | |
207 Send(new DevToolsAgentHostMsg_ShowCertificateViewer( | |
208 routing_id(), cert_vector)); | |
209 } | |
210 | |
201 // static | 211 // static |
202 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) { | 212 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) { |
203 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id); | 213 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id); |
204 if (it != g_agent_for_routing_id.Get().end()) { | 214 if (it != g_agent_for_routing_id.Get().end()) { |
205 return it->second; | 215 return it->second; |
206 } | 216 } |
207 return NULL; | 217 return NULL; |
208 } | 218 } |
209 | 219 |
210 // static | 220 // static |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 result->Set("errors", errors.release()); | 354 result->Set("errors", errors.release()); |
345 response->Set("result", result.release()); | 355 response->Set("result", result.release()); |
346 | 356 |
347 std::string json_message; | 357 std::string json_message; |
348 base::JSONWriter::Write(*response, &json_message); | 358 base::JSONWriter::Write(*response, &json_message); |
349 SendChunkedProtocolMessage(this, routing_id(), session_id, call_id, | 359 SendChunkedProtocolMessage(this, routing_id(), session_id, call_id, |
350 json_message, std::string()); | 360 json_message, std::string()); |
351 } | 361 } |
352 | 362 |
353 } // namespace content | 363 } // namespace content |
OLD | NEW |