Changeset 121835 in webkit


Ignore:
Timestamp:
Jul 4, 2012 12:33:41 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Ewk_View should report load errors
https://bugs.webkit.org/show_bug.cgi?id=90479

Patch by Christophe Dumez <Christophe Dumez> on 2012-07-04
Reviewed by Kenneth Rohde Christiansen.

The Ewk_View now emits a "load,error" signal when the
main frame fails loading. Information about the error
is provided via the new Ewk_Web_Error type.

  • PlatformEfl.cmake:
  • UIProcess/API/efl/EWebKit2.h:
  • UIProcess/API/efl/ewk_view.cpp:

(ewk_view_load_error):

  • UIProcess/API/efl/ewk_view.h:
  • UIProcess/API/efl/ewk_view_loader_client.cpp:

(didFailLoadWithErrorForFrame):
(ewk_view_loader_client_attach):

  • UIProcess/API/efl/ewk_view_private.h:
  • UIProcess/API/efl/ewk_web_error.cpp: Added.

(_Ewk_Web_Error):
(ewk_web_error_free):
(ewk_web_error_domain_get):
(ewk_web_error_url_get):
(ewk_web_error_code_get):
(ewk_web_error_description_get):
(ewk_web_error_cancellation_get):
(ewk_web_error_new):

  • UIProcess/API/efl/ewk_web_error.h: Added.
  • UIProcess/API/efl/ewk_web_error_private.h: Added.
Location:
trunk/Source/WebKit2
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r121830 r121835  
     12012-07-04  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL][WK2] Ewk_View should report load errors
     4        https://bugs.webkit.org/show_bug.cgi?id=90479
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        The Ewk_View now emits a "load,error" signal when the
     9        main frame fails loading. Information about the error
     10        is provided via the new Ewk_Web_Error type.
     11
     12        * PlatformEfl.cmake:
     13        * UIProcess/API/efl/EWebKit2.h:
     14        * UIProcess/API/efl/ewk_view.cpp:
     15        (ewk_view_load_error):
     16        * UIProcess/API/efl/ewk_view.h:
     17        * UIProcess/API/efl/ewk_view_loader_client.cpp:
     18        (didFailLoadWithErrorForFrame):
     19        (ewk_view_loader_client_attach):
     20        * UIProcess/API/efl/ewk_view_private.h:
     21        * UIProcess/API/efl/ewk_web_error.cpp: Added.
     22        (_Ewk_Web_Error):
     23        (ewk_web_error_free):
     24        (ewk_web_error_domain_get):
     25        (ewk_web_error_url_get):
     26        (ewk_web_error_code_get):
     27        (ewk_web_error_description_get):
     28        (ewk_web_error_cancellation_get):
     29        (ewk_web_error_new):
     30        * UIProcess/API/efl/ewk_web_error.h: Added.
     31        * UIProcess/API/efl/ewk_web_error_private.h: Added.
     32
    1332012-07-03  Christophe Dumez  <christophe.dumez@intel.com>
    234
  • trunk/Source/WebKit2/PlatformEfl.cmake

    r121732 r121835  
    3737    UIProcess/API/efl/ewk_view.cpp
    3838    UIProcess/API/efl/ewk_view_loader_client.cpp
     39    UIProcess/API/efl/ewk_web_error.cpp
    3940
    4041    UIProcess/cairo/BackingStoreCairo.cpp
  • trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h

    r121732 r121835  
    3232#include "ewk_intent_service.h"
    3333#include "ewk_view.h"
     34#include "ewk_web_error.h"
    3435
    3536#endif // EWebKit2_h
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

    r121830 r121835  
    679679}
    680680
     681/**
     682 * @internal
     683 * Reports load failed with error information.
     684 *
     685 * Emits signal: "load,error" with pointer to Ewk_Web_Error.
     686 */
     687void ewk_view_load_error(Evas_Object* ewkView, const Ewk_Web_Error* error)
     688{
     689    evas_object_smart_callback_call(ewkView, "load,error", const_cast<Ewk_Web_Error*>(error));
     690}
     691
     692
    681693#if ENABLE(WEB_INTENTS_TAG)
    682694/**
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h

    r121830 r121835  
    2929 * - "intent,request,new", Ewk_Intent_Request*: reports new Web intent request.
    3030 * - "intent,service,register", Ewk_Intent_Service*: reports new Web intent service registration.
     31 * - "load,error", const Ewk_Web_Error*: reports main frame load failed.
    3132 * - "load,progress", double*: load progress has changed (value from 0.0 to 1.0).
    3233 * - "title,changed", const char*: title of the main frame was changed.
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp

    r121830 r121835  
    3333#include "ewk_view_loader_client_private.h"
    3434#include "ewk_view_private.h"
     35#include "ewk_web_error.h"
     36#include "ewk_web_error_private.h"
    3537#include <wtf/text/CString.h>
    3638
     
    7274}
    7375
     76static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void *clientInfo)
     77{
     78    if (!WKFrameIsMainFrame(frame))
     79        return;
     80
     81    Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
     82    Ewk_Web_Error* ewkError = ewk_web_error_new(error);
     83    ewk_view_load_error(ewkView, ewkError);
     84    ewk_web_error_free(ewkError);
     85}
     86
    7487void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
    7588{
     
    88101    loadClient.didChangeProgress = didChangeProgress;
    89102    loadClient.didFinishProgress = didChangeProgress;
     103    loadClient.didFailLoadWithErrorForFrame = didFailLoadWithErrorForFrame;
    90104    WKPageSetPageLoaderClient(pageRef, &loadClient);
    91105}
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h

    r121830 r121835  
    3131}
    3232
     33typedef struct _Ewk_Web_Error Ewk_Web_Error;
    3334#if ENABLE(WEB_INTENTS)
    3435typedef struct _Ewk_Intent Ewk_Intent;
     
    4041void ewk_view_display(Evas_Object* ewkView, const WebCore::IntRect& rect);
    4142void ewk_view_image_data_set(Evas_Object* ewkView, void* imageData, const WebCore::IntSize& size);
     43void ewk_view_load_error(Evas_Object* ewkView, const Ewk_Web_Error* error);
    4244void ewk_view_load_progress_changed(Evas_Object* ewkView, double progress);
    4345void ewk_view_title_changed(Evas_Object* ewkView, const char* title);
Note: See TracChangeset for help on using the changeset viewer.