1/*
2 * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
17 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "config.h"
26
27#include "WebInspectorProxy.h"
28
29#include "ArgumentCoders.h"
30#include "Attachment.h"
31#include "Decoder.h"
32#include "HandleMessage.h"
33#include "WebCoreArgumentCoders.h"
34#include "WebInspectorProxyMessages.h"
35#include <WebCore/CertificateInfo.h>
36#include <WebCore/FloatRect.h>
37#include <wtf/text/WTFString.h>
38
39namespace WebKit {
40
41void WebInspectorProxy::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
42{
43 if (decoder.messageName() == Messages::WebInspectorProxy::OpenLocalInspectorFrontend::name()) {
44 IPC::handleMessage<Messages::WebInspectorProxy::OpenLocalInspectorFrontend>(decoder, this, &WebInspectorProxy::openLocalInspectorFrontend);
45 return;
46 }
47 if (decoder.messageName() == Messages::WebInspectorProxy::SetFrontendConnection::name()) {
48 IPC::handleMessage<Messages::WebInspectorProxy::SetFrontendConnection>(decoder, this, &WebInspectorProxy::setFrontendConnection);
49 return;
50 }
51 if (decoder.messageName() == Messages::WebInspectorProxy::SendMessageToBackend::name()) {
52 IPC::handleMessage<Messages::WebInspectorProxy::SendMessageToBackend>(decoder, this, &WebInspectorProxy::sendMessageToBackend);
53 return;
54 }
55 if (decoder.messageName() == Messages::WebInspectorProxy::FrontendLoaded::name()) {
56 IPC::handleMessage<Messages::WebInspectorProxy::FrontendLoaded>(decoder, this, &WebInspectorProxy::frontendLoaded);
57 return;
58 }
59 if (decoder.messageName() == Messages::WebInspectorProxy::DidClose::name()) {
60 IPC::handleMessage<Messages::WebInspectorProxy::DidClose>(decoder, this, &WebInspectorProxy::didClose);
61 return;
62 }
63 if (decoder.messageName() == Messages::WebInspectorProxy::BringToFront::name()) {
64 IPC::handleMessage<Messages::WebInspectorProxy::BringToFront>(decoder, this, &WebInspectorProxy::bringToFront);
65 return;
66 }
67 if (decoder.messageName() == Messages::WebInspectorProxy::Reopen::name()) {
68 IPC::handleMessage<Messages::WebInspectorProxy::Reopen>(decoder, this, &WebInspectorProxy::reopen);
69 return;
70 }
71 if (decoder.messageName() == Messages::WebInspectorProxy::InspectedURLChanged::name()) {
72 IPC::handleMessage<Messages::WebInspectorProxy::InspectedURLChanged>(decoder, this, &WebInspectorProxy::inspectedURLChanged);
73 return;
74 }
75 if (decoder.messageName() == Messages::WebInspectorProxy::ShowCertificate::name()) {
76 IPC::handleMessage<Messages::WebInspectorProxy::ShowCertificate>(decoder, this, &WebInspectorProxy::showCertificate);
77 return;
78 }
79 if (decoder.messageName() == Messages::WebInspectorProxy::ElementSelectionChanged::name()) {
80 IPC::handleMessage<Messages::WebInspectorProxy::ElementSelectionChanged>(decoder, this, &WebInspectorProxy::elementSelectionChanged);
81 return;
82 }
83 if (decoder.messageName() == Messages::WebInspectorProxy::Save::name()) {
84 IPC::handleMessage<Messages::WebInspectorProxy::Save>(decoder, this, &WebInspectorProxy::save);
85 return;
86 }
87 if (decoder.messageName() == Messages::WebInspectorProxy::Append::name()) {
88 IPC::handleMessage<Messages::WebInspectorProxy::Append>(decoder, this, &WebInspectorProxy::append);
89 return;
90 }
91 if (decoder.messageName() == Messages::WebInspectorProxy::AttachBottom::name()) {
92 IPC::handleMessage<Messages::WebInspectorProxy::AttachBottom>(decoder, this, &WebInspectorProxy::attachBottom);
93 return;
94 }
95 if (decoder.messageName() == Messages::WebInspectorProxy::AttachRight::name()) {
96 IPC::handleMessage<Messages::WebInspectorProxy::AttachRight>(decoder, this, &WebInspectorProxy::attachRight);
97 return;
98 }
99 if (decoder.messageName() == Messages::WebInspectorProxy::AttachLeft::name()) {
100 IPC::handleMessage<Messages::WebInspectorProxy::AttachLeft>(decoder, this, &WebInspectorProxy::attachLeft);
101 return;
102 }
103 if (decoder.messageName() == Messages::WebInspectorProxy::Detach::name()) {
104 IPC::handleMessage<Messages::WebInspectorProxy::Detach>(decoder, this, &WebInspectorProxy::detach);
105 return;
106 }
107 if (decoder.messageName() == Messages::WebInspectorProxy::AttachAvailabilityChanged::name()) {
108 IPC::handleMessage<Messages::WebInspectorProxy::AttachAvailabilityChanged>(decoder, this, &WebInspectorProxy::attachAvailabilityChanged);
109 return;
110 }
111 if (decoder.messageName() == Messages::WebInspectorProxy::SetAttachedWindowHeight::name()) {
112 IPC::handleMessage<Messages::WebInspectorProxy::SetAttachedWindowHeight>(decoder, this, &WebInspectorProxy::setAttachedWindowHeight);
113 return;
114 }
115 if (decoder.messageName() == Messages::WebInspectorProxy::SetAttachedWindowWidth::name()) {
116 IPC::handleMessage<Messages::WebInspectorProxy::SetAttachedWindowWidth>(decoder, this, &WebInspectorProxy::setAttachedWindowWidth);
117 return;
118 }
119 if (decoder.messageName() == Messages::WebInspectorProxy::SetSheetRect::name()) {
120 IPC::handleMessage<Messages::WebInspectorProxy::SetSheetRect>(decoder, this, &WebInspectorProxy::setSheetRect);
121 return;
122 }
123 if (decoder.messageName() == Messages::WebInspectorProxy::StartWindowDrag::name()) {
124 IPC::handleMessage<Messages::WebInspectorProxy::StartWindowDrag>(decoder, this, &WebInspectorProxy::startWindowDrag);
125 return;
126 }
127 UNUSED_PARAM(connection);
128 UNUSED_PARAM(decoder);
129 ASSERT_NOT_REACHED();
130}
131
132} // namespace WebKit
133
134