|
1 /* |
|
2 * Copyright (C) 2010 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'' |
|
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
|
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
|
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
|
23 * THE POSSIBILITY OF SUCH DAMAGE. |
|
24 */ |
|
25 |
|
26 #include "WebPage.h" |
|
27 |
|
28 #include "Arguments.h" |
|
29 #include "DrawingArea.h" |
|
30 #include "InjectedBundle.h" |
|
31 #include "MessageID.h" |
|
32 #include "WebBackForwardControllerClient.h" |
|
33 #include "WebBackForwardListProxy.h" |
|
34 #include "WebChromeClient.h" |
|
35 #include "WebContextMenuClient.h" |
|
36 #include "WebCoreArgumentCoders.h" |
|
37 #include "WebDragClient.h" |
|
38 #include "WebEditorClient.h" |
|
39 #include "WebEvent.h" |
|
40 #include "WebEventConversion.h" |
|
41 #include "WebFrame.h" |
|
42 #include "WebInspectorClient.h" |
|
43 #include "WebPageMessageKinds.h" |
|
44 #include "WebPageProxyMessageKinds.h" |
|
45 #include "WebPreferencesStore.h" |
|
46 #include "WebProcess.h" |
|
47 #include <WebCore/BackForwardList.h> |
|
48 #include <WebCore/EventHandler.h> |
|
49 #include <WebCore/FocusController.h> |
|
50 #include <WebCore/Frame.h> |
|
51 #include <WebCore/FrameLoaderTypes.h> |
|
52 #include <WebCore/FrameView.h> |
|
53 #include <WebCore/HistoryItem.h> |
|
54 #include <WebCore/KeyboardEvent.h> |
|
55 #include <WebCore/Page.h> |
|
56 #include <WebCore/PlatformKeyboardEvent.h> |
|
57 #include <WebCore/RenderTreeAsText.h> |
|
58 #include <WebCore/ResourceRequest.h> |
|
59 #include <WebCore/Settings.h> |
|
60 #include <runtime/JSLock.h> |
|
61 #include <runtime/JSValue.h> |
|
62 |
|
63 #ifndef NDEBUG |
|
64 #include <wtf/RefCountedLeakCounter.h> |
|
65 #endif |
|
66 |
|
67 using namespace JSC; |
|
68 using namespace WebCore; |
|
69 |
|
70 namespace WebKit { |
|
71 |
|
72 #ifndef NDEBUG |
|
73 static WTF::RefCountedLeakCounter webPageCounter("WebPage"); |
|
74 #endif |
|
75 |
|
76 PassRefPtr<WebPage> WebPage::create(uint64_t pageID, const IntSize& viewSize, const WebPreferencesStore& store, DrawingArea::Type drawingAreaType) |
|
77 { |
|
78 return adoptRef(new WebPage(pageID, viewSize, store, drawingAreaType)); |
|
79 } |
|
80 |
|
81 WebPage::WebPage(uint64_t pageID, const IntSize& viewSize, const WebPreferencesStore& store, DrawingArea::Type drawingAreaType) |
|
82 : m_page(new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this), 0, 0, 0, new WebBackForwardControllerClient(this))) |
|
83 , m_viewSize(viewSize) |
|
84 , m_drawingArea(DrawingArea::create(drawingAreaType, this)) |
|
85 , m_pageID(pageID) |
|
86 { |
|
87 ASSERT(m_pageID); |
|
88 |
|
89 m_page->settings()->setJavaScriptEnabled(store.javaScriptEnabled); |
|
90 m_page->settings()->setLoadsImagesAutomatically(store.loadsImagesAutomatically); |
|
91 m_page->settings()->setPluginsEnabled(store.pluginsEnabled); |
|
92 m_page->settings()->setOfflineWebApplicationCacheEnabled(store.offlineWebApplicationCacheEnabled); |
|
93 m_page->settings()->setLocalStorageEnabled(store.localStorageEnabled); |
|
94 m_page->settings()->setMinimumFontSize(store.minimumFontSize); |
|
95 m_page->settings()->setMinimumLogicalFontSize(store.minimumLogicalFontSize); |
|
96 m_page->settings()->setDefaultFontSize(store.defaultFontSize); |
|
97 m_page->settings()->setDefaultFixedFontSize(store.defaultFixedFontSize); |
|
98 m_page->settings()->setStandardFontFamily(store.standardFontFamily); |
|
99 m_page->settings()->setCursiveFontFamily(store.cursiveFontFamily); |
|
100 m_page->settings()->setFantasyFontFamily(store.fantasyFontFamily); |
|
101 m_page->settings()->setFixedFontFamily(store.fixedFontFamily); |
|
102 m_page->settings()->setSansSerifFontFamily(store.sansSerifFontFamily); |
|
103 m_page->settings()->setSerifFontFamily(store.serifFontFamily); |
|
104 |
|
105 platformInitialize(); |
|
106 |
|
107 m_mainFrame = WebFrame::createMainFrame(this); |
|
108 WebProcess::shared().connection()->send(WebPageProxyMessage::DidCreateMainFrame, m_pageID, CoreIPC::In(m_mainFrame->frameID())); |
|
109 |
|
110 if (WebProcess::shared().injectedBundle()) |
|
111 WebProcess::shared().injectedBundle()->didCreatePage(this); |
|
112 |
|
113 #ifndef NDEBUG |
|
114 webPageCounter.increment(); |
|
115 #endif |
|
116 } |
|
117 |
|
118 WebPage::~WebPage() |
|
119 { |
|
120 ASSERT(!m_page); |
|
121 #ifndef NDEBUG |
|
122 webPageCounter.decrement(); |
|
123 #endif |
|
124 } |
|
125 |
|
126 void WebPage::initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient* client) |
|
127 { |
|
128 m_loaderClient.initialize(client); |
|
129 } |
|
130 |
|
131 void WebPage::initializeInjectedBundleUIClient(WKBundlePageUIClient* client) |
|
132 { |
|
133 m_uiClient.initialize(client); |
|
134 } |
|
135 |
|
136 String WebPage::renderTreeExternalRepresentation() const |
|
137 { |
|
138 return externalRepresentation(m_mainFrame->coreFrame(), RenderAsTextBehaviorNormal); |
|
139 } |
|
140 |
|
141 #if USE(ACCELERATED_COMPOSITING) |
|
142 void WebPage::changeAcceleratedCompositingMode(WebCore::GraphicsLayer* layer) |
|
143 { |
|
144 bool compositing = layer; |
|
145 |
|
146 // Tell the UI process that accelerated compositing changed. It may respond by changing |
|
147 // drawing area types. |
|
148 uint32_t newDrawingAreaType; |
|
149 WebProcess::shared().connection()->sendSync(WebPageProxyMessage::DidChangeAcceleratedCompositing, |
|
150 m_pageID, CoreIPC::In(compositing), |
|
151 CoreIPC::Out(newDrawingAreaType), |
|
152 CoreIPC::Connection::NoTimeout); |
|
153 |
|
154 DrawingArea::Type newType = static_cast<DrawingArea::Type>(newDrawingAreaType); |
|
155 if (newType != drawingArea()->type()) { |
|
156 m_drawingArea = DrawingArea::create(newType, this); |
|
157 m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize)); |
|
158 } |
|
159 } |
|
160 |
|
161 void WebPage::enterAcceleratedCompositingMode(GraphicsLayer* layer) |
|
162 { |
|
163 changeAcceleratedCompositingMode(layer); |
|
164 |
|
165 #if USE(ACCELERATED_COMPOSITING) |
|
166 m_drawingArea->setRootCompositingLayer(layer); |
|
167 #endif |
|
168 } |
|
169 |
|
170 void WebPage::exitAcceleratedCompositingMode() |
|
171 { |
|
172 changeAcceleratedCompositingMode(0); |
|
173 } |
|
174 #endif |
|
175 |
|
176 WebFrame* WebPage::webFrame(uint64_t frameID) const |
|
177 { |
|
178 return m_frameMap.get(frameID); |
|
179 } |
|
180 |
|
181 void WebPage::addWebFrame(uint64_t frameID, WebFrame* frame) |
|
182 { |
|
183 m_frameMap.set(frameID, frame); |
|
184 } |
|
185 |
|
186 void WebPage::removeWebFrame(uint64_t frameID) |
|
187 { |
|
188 m_frameMap.remove(frameID); |
|
189 } |
|
190 |
|
191 void WebPage::close() |
|
192 { |
|
193 if (WebProcess::shared().injectedBundle()) |
|
194 WebProcess::shared().injectedBundle()->willDestroyPage(this); |
|
195 |
|
196 m_mainFrame->coreFrame()->loader()->detachFromParent(); |
|
197 |
|
198 delete m_page; |
|
199 m_page = 0; |
|
200 |
|
201 WebProcess::shared().removeWebPage(m_pageID); |
|
202 } |
|
203 |
|
204 void WebPage::tryClose() |
|
205 { |
|
206 if (!m_mainFrame->coreFrame()->loader()->shouldClose()) |
|
207 return; |
|
208 |
|
209 WebProcess::shared().connection()->send(WebPageProxyMessage::ClosePage, m_pageID, CoreIPC::In()); |
|
210 } |
|
211 |
|
212 void WebPage::loadURL(const String& url) |
|
213 { |
|
214 m_mainFrame->coreFrame()->loader()->load(ResourceRequest(KURL(KURL(), url)), false); |
|
215 } |
|
216 |
|
217 void WebPage::stopLoading() |
|
218 { |
|
219 m_mainFrame->coreFrame()->loader()->stopForUserCancel(); |
|
220 } |
|
221 |
|
222 void WebPage::reload(bool reloadFromOrigin) |
|
223 { |
|
224 m_mainFrame->coreFrame()->loader()->reload(reloadFromOrigin); |
|
225 } |
|
226 |
|
227 void WebPage::goForward(uint64_t backForwardItemID) |
|
228 { |
|
229 HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID); |
|
230 m_page->goToItem(item, FrameLoadTypeForward); |
|
231 } |
|
232 |
|
233 void WebPage::goBack(uint64_t backForwardItemID) |
|
234 { |
|
235 HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID); |
|
236 m_page->goToItem(item, FrameLoadTypeBack); |
|
237 } |
|
238 |
|
239 void WebPage::goToBackForwardItem(uint64_t backForwardItemID) |
|
240 { |
|
241 HistoryItem* item = WebBackForwardListProxy::itemForID(backForwardItemID); |
|
242 m_page->goToItem(item, FrameLoadTypeIndexedBackForward); |
|
243 } |
|
244 |
|
245 void WebPage::layoutIfNeeded() |
|
246 { |
|
247 if (m_mainFrame->coreFrame()->view()) |
|
248 m_mainFrame->coreFrame()->view()->layoutIfNeededRecursive(); |
|
249 } |
|
250 |
|
251 void WebPage::setSize(const WebCore::IntSize& viewSize) |
|
252 { |
|
253 if (m_viewSize == viewSize) |
|
254 return; |
|
255 |
|
256 Frame* frame = m_page->mainFrame(); |
|
257 |
|
258 frame->view()->resize(viewSize); |
|
259 frame->view()->setNeedsLayout(); |
|
260 m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), viewSize)); |
|
261 |
|
262 m_viewSize = viewSize; |
|
263 } |
|
264 |
|
265 void WebPage::drawRect(GraphicsContext& graphicsContext, const IntRect& rect) |
|
266 { |
|
267 graphicsContext.save(); |
|
268 graphicsContext.clip(rect); |
|
269 m_mainFrame->coreFrame()->view()->paint(&graphicsContext, rect); |
|
270 graphicsContext.restore(); |
|
271 } |
|
272 |
|
273 // Events |
|
274 |
|
275 void WebPage::mouseEvent(const PlatformMouseEvent& event) |
|
276 { |
|
277 if (!m_mainFrame->coreFrame()->view()) |
|
278 return; |
|
279 |
|
280 switch (event.eventType()) { |
|
281 case WebCore::MouseEventPressed: |
|
282 m_mainFrame->coreFrame()->eventHandler()->handleMousePressEvent(event); |
|
283 break; |
|
284 case WebCore::MouseEventReleased: |
|
285 m_mainFrame->coreFrame()->eventHandler()->handleMouseReleaseEvent(event); |
|
286 break; |
|
287 case WebCore::MouseEventMoved: |
|
288 m_mainFrame->coreFrame()->eventHandler()->mouseMoved(event); |
|
289 break; |
|
290 default: |
|
291 ASSERT_NOT_REACHED(); |
|
292 break; |
|
293 } |
|
294 } |
|
295 |
|
296 void WebPage::wheelEvent(PlatformWheelEvent& event) |
|
297 { |
|
298 if (!m_mainFrame->coreFrame()->view()) |
|
299 return; |
|
300 |
|
301 m_mainFrame->coreFrame()->eventHandler()->handleWheelEvent(event); |
|
302 } |
|
303 |
|
304 void WebPage::keyEvent(const PlatformKeyboardEvent& event) |
|
305 { |
|
306 if (!m_mainFrame->coreFrame()->view()) |
|
307 return; |
|
308 |
|
309 m_page->focusController()->focusedOrMainFrame()->eventHandler()->keyEvent(event); |
|
310 } |
|
311 |
|
312 void WebPage::setActive(bool isActive) |
|
313 { |
|
314 m_page->focusController()->setActive(isActive); |
|
315 } |
|
316 |
|
317 void WebPage::setFocused(bool isFocused) |
|
318 { |
|
319 m_page->focusController()->setFocused(isFocused); |
|
320 } |
|
321 |
|
322 void WebPage::setIsInWindow(bool isInWindow) |
|
323 { |
|
324 if (!isInWindow) { |
|
325 m_page->setCanStartMedia(false); |
|
326 m_page->willMoveOffscreen(); |
|
327 } else { |
|
328 m_page->setCanStartMedia(true); |
|
329 m_page->didMoveOnscreen(); |
|
330 } |
|
331 } |
|
332 |
|
333 void WebPage::didReceivePolicyDecision(WebFrame* frame, uint64_t listenerID, WebCore::PolicyAction policyAction) |
|
334 { |
|
335 if (!frame) |
|
336 return; |
|
337 frame->didReceivePolicyDecision(listenerID, policyAction); |
|
338 } |
|
339 |
|
340 void WebPage::show() |
|
341 { |
|
342 WebProcess::shared().connection()->send(WebPageProxyMessage::ShowPage, m_pageID, CoreIPC::In()); |
|
343 } |
|
344 |
|
345 void WebPage::runJavaScriptInMainFrame(const WebCore::String& script, uint64_t callbackID) |
|
346 { |
|
347 // NOTE: We need to be careful when running scripts that the objects we depend on don't |
|
348 // disappear during script execution. |
|
349 |
|
350 JSLock lock(SilenceAssertionsOnly); |
|
351 JSValue resultValue = m_mainFrame->coreFrame()->script()->executeScript(script, true).jsValue(); |
|
352 String resultString = ustringToString(resultValue.toString(m_mainFrame->coreFrame()->script()->globalObject(mainThreadNormalWorld())->globalExec())); |
|
353 |
|
354 WebProcess::shared().connection()->send(WebPageProxyMessage::DidRunJavaScriptInMainFrame, m_pageID, CoreIPC::In(resultString, callbackID)); |
|
355 } |
|
356 |
|
357 void WebPage::getRenderTreeExternalRepresentation(uint64_t callbackID) |
|
358 { |
|
359 String resultString = renderTreeExternalRepresentation(); |
|
360 WebProcess::shared().connection()->send(WebPageProxyMessage::DidGetRenderTreeExternalRepresentation, m_pageID, CoreIPC::In(resultString, callbackID)); |
|
361 } |
|
362 |
|
363 void WebPage::preferencesDidChange(const WebPreferencesStore& store) |
|
364 { |
|
365 m_page->settings()->setJavaScriptEnabled(store.javaScriptEnabled); |
|
366 m_page->settings()->setLoadsImagesAutomatically(store.loadsImagesAutomatically); |
|
367 m_page->settings()->setOfflineWebApplicationCacheEnabled(store.offlineWebApplicationCacheEnabled); |
|
368 m_page->settings()->setLocalStorageEnabled(store.localStorageEnabled); |
|
369 } |
|
370 |
|
371 bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* evt) |
|
372 { |
|
373 Node* node = evt->target()->toNode(); |
|
374 ASSERT(node); |
|
375 Frame* frame = node->document()->frame(); |
|
376 ASSERT(frame); |
|
377 |
|
378 const PlatformKeyboardEvent* keyEvent = evt->keyEvent(); |
|
379 if (!keyEvent) |
|
380 return false; |
|
381 |
|
382 Editor::Command command = frame->editor()->command(interpretKeyEvent(evt)); |
|
383 |
|
384 if (keyEvent->type() == PlatformKeyboardEvent::RawKeyDown) { |
|
385 // WebKit doesn't have enough information about mode to decide how commands that just insert text if executed via Editor should be treated, |
|
386 // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated |
|
387 // (e.g. Tab that inserts a Tab character, or Enter). |
|
388 return !command.isTextInsertion() && command.execute(evt); |
|
389 } |
|
390 |
|
391 if (command.execute(evt)) |
|
392 return true; |
|
393 |
|
394 // Don't insert null or control characters as they can result in unexpected behaviour |
|
395 if (evt->charCode() < ' ') |
|
396 return false; |
|
397 |
|
398 return frame->editor()->insertText(evt->keyEvent()->text(), evt); |
|
399 } |
|
400 |
|
401 void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments) |
|
402 { |
|
403 if (messageID.is<CoreIPC::MessageClassDrawingArea>()) { |
|
404 ASSERT(m_drawingArea); |
|
405 m_drawingArea->didReceiveMessage(connection, messageID, arguments); |
|
406 return; |
|
407 } |
|
408 |
|
409 switch (messageID.get<WebPageMessage::Kind>()) { |
|
410 case WebPageMessage::SetActive: { |
|
411 bool active; |
|
412 if (!arguments.decode(active)) |
|
413 return; |
|
414 |
|
415 setActive(active); |
|
416 return; |
|
417 } |
|
418 case WebPageMessage::SetFocused: { |
|
419 bool focused; |
|
420 if (!arguments.decode(focused)) |
|
421 return; |
|
422 |
|
423 setFocused(focused); |
|
424 return; |
|
425 } |
|
426 case WebPageMessage::SetIsInWindow: { |
|
427 bool isInWindow; |
|
428 if (!arguments.decode(isInWindow)) |
|
429 return; |
|
430 |
|
431 setIsInWindow(isInWindow); |
|
432 return; |
|
433 } |
|
434 case WebPageMessage::MouseEvent: { |
|
435 WebMouseEvent event; |
|
436 if (!arguments.decode(event)) |
|
437 return; |
|
438 connection->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In((uint32_t)event.type())); |
|
439 PlatformMouseEvent platformEvent = platform(event); |
|
440 mouseEvent(platformEvent); |
|
441 return; |
|
442 } |
|
443 case WebPageMessage::PreferencesDidChange: { |
|
444 WebPreferencesStore store; |
|
445 if (!arguments.decode(store)) |
|
446 return; |
|
447 |
|
448 preferencesDidChange(store); |
|
449 return; |
|
450 } |
|
451 case WebPageMessage::WheelEvent: { |
|
452 WebWheelEvent event; |
|
453 if (!arguments.decode(event)) |
|
454 return; |
|
455 connection->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In((uint32_t)event.type())); |
|
456 PlatformWheelEvent platformEvent = platform(event); |
|
457 wheelEvent(platformEvent); |
|
458 return; |
|
459 } |
|
460 case WebPageMessage::KeyEvent: { |
|
461 WebKeyboardEvent event; |
|
462 if (!arguments.decode(event)) |
|
463 return; |
|
464 connection->send(WebPageProxyMessage::DidReceiveEvent, m_pageID, CoreIPC::In((uint32_t)event.type())); |
|
465 PlatformKeyboardEvent platformEvent = platform(event); |
|
466 keyEvent(platformEvent); |
|
467 return; |
|
468 } |
|
469 case WebPageMessage::LoadURL: { |
|
470 String url; |
|
471 if (!arguments.decode(url)) |
|
472 return; |
|
473 |
|
474 loadURL(url); |
|
475 return; |
|
476 } |
|
477 case WebPageMessage::StopLoading: |
|
478 stopLoading(); |
|
479 break; |
|
480 case WebPageMessage::Reload: { |
|
481 bool reloadFromOrigin; |
|
482 if (!arguments.decode(CoreIPC::Out(reloadFromOrigin))) |
|
483 return; |
|
484 |
|
485 reload(reloadFromOrigin); |
|
486 return; |
|
487 } |
|
488 case WebPageMessage::GoForward: { |
|
489 uint64_t backForwardItemID; |
|
490 if (!arguments.decode(CoreIPC::Out(backForwardItemID))) |
|
491 return; |
|
492 goForward(backForwardItemID); |
|
493 return; |
|
494 } |
|
495 case WebPageMessage::GoBack: { |
|
496 uint64_t backForwardItemID; |
|
497 if (!arguments.decode(CoreIPC::Out(backForwardItemID))) |
|
498 return; |
|
499 goBack(backForwardItemID); |
|
500 return; |
|
501 } |
|
502 case WebPageMessage::GoToBackForwardItem: { |
|
503 uint64_t backForwardItemID; |
|
504 if (!arguments.decode(CoreIPC::Out(backForwardItemID))) |
|
505 return; |
|
506 goToBackForwardItem(backForwardItemID); |
|
507 return; |
|
508 } |
|
509 case WebPageMessage::DidReceivePolicyDecision: { |
|
510 uint64_t frameID; |
|
511 uint64_t listenerID; |
|
512 uint32_t policyAction; |
|
513 if (!arguments.decode(CoreIPC::Out(frameID, listenerID, policyAction))) |
|
514 return; |
|
515 didReceivePolicyDecision(webFrame(frameID), listenerID, (WebCore::PolicyAction)policyAction); |
|
516 return; |
|
517 } |
|
518 case WebPageMessage::RunJavaScriptInMainFrame: { |
|
519 String script; |
|
520 uint64_t callbackID; |
|
521 if (!arguments.decode(CoreIPC::Out(script, callbackID))) |
|
522 return; |
|
523 runJavaScriptInMainFrame(script, callbackID); |
|
524 return; |
|
525 } |
|
526 case WebPageMessage::GetRenderTreeExternalRepresentation: { |
|
527 uint64_t callbackID; |
|
528 if (!arguments.decode(callbackID)) |
|
529 return; |
|
530 getRenderTreeExternalRepresentation(callbackID); |
|
531 return; |
|
532 } |
|
533 case WebPageMessage::Close: { |
|
534 close(); |
|
535 return; |
|
536 } |
|
537 case WebPageMessage::TryClose: { |
|
538 tryClose(); |
|
539 return; |
|
540 } |
|
541 } |
|
542 |
|
543 ASSERT_NOT_REACHED(); |
|
544 } |
|
545 |
|
546 } // namespace WebKit |