OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/protocol/network_handler.h" | 5 #include "content/browser/devtools/protocol/network_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 NetworkHandler::NetworkHandler() : host_(nullptr), weak_factory_(this) { | 194 NetworkHandler::NetworkHandler() : host_(nullptr), weak_factory_(this) { |
195 } | 195 } |
196 | 196 |
197 NetworkHandler::~NetworkHandler() { | 197 NetworkHandler::~NetworkHandler() { |
198 } | 198 } |
199 | 199 |
200 void NetworkHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { | 200 void NetworkHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { |
201 host_ = host; | 201 host_ = host; |
202 } | 202 } |
203 | 203 |
204 void NetworkHandler::SetClient(scoped_ptr<Client> client) { | 204 void NetworkHandler::SetClient(std::unique_ptr<Client> client) { |
205 client_.swap(client); | 205 client_.swap(client); |
206 } | 206 } |
207 | 207 |
208 Response NetworkHandler::ClearBrowserCache() { | 208 Response NetworkHandler::ClearBrowserCache() { |
209 if (host_) | 209 if (host_) |
210 GetContentClient()->browser()->ClearCache(host_); | 210 GetContentClient()->browser()->ClearCache(host_); |
211 return Response::OK(); | 211 return Response::OK(); |
212 } | 212 } |
213 | 213 |
214 Response NetworkHandler::ClearBrowserCookies() { | 214 Response NetworkHandler::ClearBrowserCookies() { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 return Response::InternalError("Could not connect to view"); | 330 return Response::InternalError("Could not connect to view"); |
331 WebContents* web_contents = WebContents::FromRenderFrameHost(host_); | 331 WebContents* web_contents = WebContents::FromRenderFrameHost(host_); |
332 web_contents->GetDelegate()->ShowCertificateViewerInDevTools( | 332 web_contents->GetDelegate()->ShowCertificateViewerInDevTools( |
333 web_contents, certificate_id); | 333 web_contents, certificate_id); |
334 return Response::OK(); | 334 return Response::OK(); |
335 } | 335 } |
336 | 336 |
337 } // namespace network | 337 } // namespace network |
338 } // namespace devtools | 338 } // namespace devtools |
339 } // namespace content | 339 } // namespace content |
OLD | NEW |