[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / browser / devtools / protocol / inspector_handler.cc
blob31e9d1bf9c672045322e92d02bd41bdcbc4da60b
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
3 // found in the LICENSE file.
5 #include "content/browser/devtools/protocol/inspector_handler.h"
7 #include "content/browser/frame_host/render_frame_host_impl.h"
9 namespace content {
10 namespace devtools {
11 namespace inspector {
13 using Response = DevToolsProtocolClient::Response;
15 InspectorHandler::InspectorHandler()
16 : host_(nullptr) {
19 InspectorHandler::~InspectorHandler() {
22 void InspectorHandler::SetClient(scoped_ptr<Client> client) {
23 client_.swap(client);
26 void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
27 host_ = host;
30 void InspectorHandler::TargetCrashed() {
31 client_->TargetCrashed(TargetCrashedParams::Create());
34 void InspectorHandler::TargetDetached(const std::string& reason) {
35 client_->Detached(DetachedParams::Create()->set_reason(reason));
38 Response InspectorHandler::Enable() {
39 if (host_ && !host_->IsRenderFrameLive())
40 client_->TargetCrashed(TargetCrashedParams::Create());
41 return Response::FallThrough();
45 } // namespace inspector
46 } // namespace devtools
47 } // namespace content