webkit-1.0.1/WebCore/loader/DocLoader.cpp

9494CachedImage* DocLoader::requestImage(const String& url)
9595{
9696 CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
 97
 98 m_frame->loader()->willSendImageRequest( url );
 99
97100 if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
98101 resource->setLoading(true);
99102 cache()->loader()->load(this, resource, true);

101104 return resource;
102105}
103106
 107bool DocLoader::loadResource(const String& url, PassRefPtr<SharedBuffer> data)
 108{
 109 CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
 110
 111 setLoadInProgress(true);
 112
 113 resource->data(data, true);
 114 resource->finish();
 115
 116 setLoadInProgress(false);
 117
 118 return true;
 119}
 120
 121
104122CachedFont* DocLoader::requestFont(const String& url)
105123{
106124 return static_cast<CachedFont*>(requestResource(CachedResource::FontResource, url, String()));

webkit-1.0.1/WebCore/loader/DocLoader.h

7070 CachedResource* cachedResource(const String& url) const { return m_docResources.get(url); }
7171 const HashMap<String, CachedResource*>& allCachedResources() const { return m_docResources; }
7272
 73 bool loadResource(const String& url, PassRefPtr<SharedBuffer> data);
 74
7375 bool autoLoadImages() const { return m_autoLoadImages; }
7476 void setAutoLoadImages(bool);
7577

webkit-1.0.1/WebCore/loader/FrameLoader.cpp

49214921 page->inspectorController()->didFinishLoading(loader, identifier);
49224922}
49234923
 4924void FrameLoader::willSendImageRequest( const String& uri )
 4925{
 4926 m_client->dispatchWillLoadImage( uri );
 4927}
49244928#if USE(LOW_BANDWIDTH_DISPLAY)
49254929
49264930bool FrameLoader::addLowBandwidthDisplayRequest(CachedResource* cache)

webkit-1.0.1/WebCore/loader/FrameLoader.h

210210 void receivedMainResourceError(const ResourceError&, bool isComplete);
211211 void receivedData(const char*, int);
212212
 213 void willSendImageRequest(const String &uri);
 214
213215 void handleFallbackContent();
214216 bool isStopping() const;
215217

webkit-1.0.1/WebCore/loader/FrameLoaderClient.h

123123 virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>) = 0;
124124 virtual void cancelPolicyCheck() = 0;
125125
 126 virtual void dispatchWillLoadImage(const String &uri) { } ;
 127
126128 virtual void dispatchUnableToImplementPolicy(const ResourceError&) = 0;
127129
128130 virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr<FormState>) = 0;

webkit-1.0.1/WebCore/platform/gtk/TemporaryLinkStubs.cpp

6868
6969String KURL::fileSystemPath() const { notImplemented(); return String(); }
7070
71 PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&) { notImplemented(); return 0; }
 71//PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&) { notImplemented(); return 0; }
 72
 73PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath)
 74{
 75 if (filePath.isEmpty())
 76 return 0;
 77
 78 gchar* filename = g_filename_from_utf8(filePath.utf8().data(), -1, 0, 0, 0);
 79 if (!filename)
 80 return 0;
 81
 82 gchar* contents;
 83 gsize size;
 84 GError* error = 0;
 85 if (!g_file_get_contents(filename, &contents, &size, &error)) {
 86 LOG_ERROR("Failed to fully read contents of file %s - %s", filePath.utf8().data(), error->message);
 87 g_error_free(error);
 88 g_free(filename);
 89 return 0;
 90 }
 91
 92 RefPtr<SharedBuffer> result = SharedBuffer::create(contents, size);
 93 g_free(filename);
 94 g_free(contents);
 95
 96 return result.release();
 97}
 98
7299
73100}
74101

webkit-1.0.1/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

5252#include <sys/utsname.h>
5353#endif
5454
 55#include <glib.h>
 56#include <glib/gprintf.h>
 57
 58#define NOTIMPLEMENTED g_printf( "%s: not done\n", __FUNCTION__ ); notImplemented
5559using namespace WebCore;
5660
5761namespace WebKit {

7680#elif defined(GDK_WINDOWING_DIRECTFB)
7781 return "DirectFB";
7882#else
79  notImplemented();
 83 NOTIMPLEMENTED();
8084 return "Unknown";
8185#endif
8286}

99103 // FIXME: Compute the Windows version
100104 return "Windows";
101105#else
102  notImplemented();
 106 NOTIMPLEMENTED();
103107 return "Unknown";
104108#endif
105109}

192196
193197void FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&)
194198{
195  notImplemented();
 199 NOTIMPLEMENTED();
196200}
197201
198202void FrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&)
199203{
200  notImplemented();
 204 NOTIMPLEMENTED();
201205}
202206
203207void FrameLoaderClient::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&)
204208{
205  notImplemented();
 209 NOTIMPLEMENTED();
206210}
207211
208212void FrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&)
209213{
210  notImplemented();
 214 NOTIMPLEMENTED();
211215}
212216
213217void FrameLoaderClient::postProgressStartedNotification()

216220 g_signal_emit_by_name(webView, "load-started", m_frame);
217221}
218222
 223void FrameLoaderClient::dispatchWillLoadImage(const WebCore::String &uri)
 224{
 225 WebKitWebView* webView = getViewFromFrame(m_frame);
 226 g_signal_emit_by_name(webView, "image-requested", uri.utf8().data());
 227 NOTIMPLEMENTED();
 228}
 229
219230void FrameLoaderClient::postProgressEstimateChangedNotification()
220231{
221232 WebKitWebView* webView = getViewFromFrame(m_frame);

325336Widget* FrameLoaderClient::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL,
326337 const Vector<String>& paramNames, const Vector<String>& paramValues)
327338{
328  notImplemented();
 339 NOTIMPLEMENTED();
329340 return 0;
330341}
331342

353364
354365String FrameLoaderClient::overrideMediaType() const
355366{
356  notImplemented();
 367 NOTIMPLEMENTED();
357368 return String();
358369}
359370

388399
389400void FrameLoaderClient::registerForIconNotification(bool)
390401{
391  notImplemented();
 402 NOTIMPLEMENTED();
392403}
393404
394405void FrameLoaderClient::setMainFrameDocumentReady(bool)

398409
399410bool FrameLoaderClient::hasWebView() const
400411{
401  notImplemented();
 412 NOTIMPLEMENTED();
402413 return true;
403414}
404415
405416bool FrameLoaderClient::hasFrameView() const
406417{
407  notImplemented();
 418 NOTIMPLEMENTED();
408419 return true;
409420}
410421

415426
416427void FrameLoaderClient::frameLoadCompleted()
417428{
418  notImplemented();
 429 NOTIMPLEMENTED();
419430}
420431
421432void FrameLoaderClient::saveViewStateToItem(HistoryItem*)
422433{
423  notImplemented();
 434 NOTIMPLEMENTED();
424435}
425436
426437void FrameLoaderClient::restoreViewState()
427438{
428  notImplemented();
 439 NOTIMPLEMENTED();
429440}
430441
431442bool FrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const

438449
439450void FrameLoaderClient::makeRepresentation(DocumentLoader*)
440451{
441  notImplemented();
 452 NOTIMPLEMENTED();
442453}
443454
444455void FrameLoaderClient::forceLayout()
445456{
446  notImplemented();
 457 NOTIMPLEMENTED();
447458}
448459
449460void FrameLoaderClient::forceLayoutForNonHTML()
450461{
451  notImplemented();
 462 NOTIMPLEMENTED();
452463}
453464
454465void FrameLoaderClient::setCopiesOnScroll()
455466{
456  notImplemented();
 467 NOTIMPLEMENTED();
457468}
458469
459470void FrameLoaderClient::detachedFromParent1()
460471{
461  notImplemented();
 472 NOTIMPLEMENTED();
462473}
463474
464475void FrameLoaderClient::detachedFromParent2()
465476{
466  notImplemented();
 477 NOTIMPLEMENTED();
467478}
468479
469480void FrameLoaderClient::detachedFromParent3()
470481{
471  notImplemented();
 482 NOTIMPLEMENTED();
472483}
473484
474485void FrameLoaderClient::detachedFromParent4()

480491
481492void FrameLoaderClient::loadedFromCachedPage()
482493{
483  notImplemented();
 494 NOTIMPLEMENTED();
484495}
485496
486497void FrameLoaderClient::dispatchDidHandleOnloadEvents()
487498{
488  notImplemented();
 499 NOTIMPLEMENTED();
489500}
490501
491502void FrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
492503{
493  notImplemented();
 504 NOTIMPLEMENTED();
494505}
495506
496507void FrameLoaderClient::dispatchDidCancelClientRedirect()
497508{
498  notImplemented();
 509 NOTIMPLEMENTED();
499510}
500511
501512void FrameLoaderClient::dispatchWillPerformClientRedirect(const KURL&, double, double)
502513{
503  notImplemented();
 514 NOTIMPLEMENTED();
504515}
505516
506517void FrameLoaderClient::dispatchDidChangeLocationWithinPage()
507518{
508  notImplemented();
 519 NOTIMPLEMENTED();
509520}
510521
511522void FrameLoaderClient::dispatchWillClose()
512523{
513  notImplemented();
 524 NOTIMPLEMENTED();
514525}
515526
516527void FrameLoaderClient::dispatchDidReceiveIcon()

551562
552563void FrameLoaderClient::dispatchDidFinishDocumentLoad()
553564{
554  notImplemented();
 565 NOTIMPLEMENTED();
555566}
556567
557568void FrameLoaderClient::dispatchDidFirstLayout()
558569{
559  notImplemented();
 570 NOTIMPLEMENTED();
560571}
561572
562573void FrameLoaderClient::dispatchShow()
563574{
564  notImplemented();
 575 NOTIMPLEMENTED();
565576}
566577
567578void FrameLoaderClient::cancelPolicyCheck()
568579{
569  notImplemented();
 580 NOTIMPLEMENTED();
570581}
571582
572583void FrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader*)
573584{
574  notImplemented();
 585 NOTIMPLEMENTED();
575586}
576587
577588void FrameLoaderClient::revertToProvisionalState(DocumentLoader*)
578589{
579  notImplemented();
 590 NOTIMPLEMENTED();
580591}
581592
582593void FrameLoaderClient::willChangeTitle(DocumentLoader*)
583594{
584  notImplemented();
 595 NOTIMPLEMENTED();
585596}
586597
587598void FrameLoaderClient::didChangeTitle(DocumentLoader *l)

591602
592603bool FrameLoaderClient::canHandleRequest(const ResourceRequest&) const
593604{
594  notImplemented();
 605 NOTIMPLEMENTED();
595606 return true;
596607}
597608
598609bool FrameLoaderClient::canShowMIMEType(const String&) const
599610{
600  notImplemented();
 611 NOTIMPLEMENTED();
601612 return true;
602613}
603614
604615bool FrameLoaderClient::representationExistsForURLScheme(const String&) const
605616{
606  notImplemented();
 617 NOTIMPLEMENTED();
607618 return false;
608619}
609620
610621String FrameLoaderClient::generatedMIMETypeForURLScheme(const String&) const
611622{
612  notImplemented();
 623 NOTIMPLEMENTED();
613624 return String();
614625}
615626

627638
628639void FrameLoaderClient::provisionalLoadStarted()
629640{
630  notImplemented();
 641 NOTIMPLEMENTED();
631642}
632643
633644void FrameLoaderClient::didFinishLoad() {
634  notImplemented();
 645 NOTIMPLEMENTED();
635646}
636647
637 void FrameLoaderClient::prepareForDataSourceReplacement() { notImplemented(); }
 648void FrameLoaderClient::prepareForDataSourceReplacement() { NOTIMPLEMENTED(); }
638649
639650void FrameLoaderClient::setTitle(const String& title, const KURL& url)
640651{

645656
646657void FrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived)
647658{
648  notImplemented();
 659 NOTIMPLEMENTED();
649660}
650661
651662void FrameLoaderClient::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier)
652663{
653  notImplemented();
 664 NOTIMPLEMENTED();
654665}
655666
656667void FrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&)
657668{
658  notImplemented();
 669 NOTIMPLEMENTED();
659670}
660671
661672bool FrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)
662673{
663  notImplemented();
 674 NOTIMPLEMENTED();
664675 return false;
665676}
666677

676687
677688void FrameLoaderClient::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&)
678689{
679  notImplemented();
 690 NOTIMPLEMENTED();
680691}
681692
682693ResourceError FrameLoaderClient::cancelledError(const ResourceRequest&)
683694{
684  notImplemented();
 695 NOTIMPLEMENTED();
685696 return ResourceError();
686697}
687698
688699ResourceError FrameLoaderClient::blockedError(const ResourceRequest&)
689700{
690  notImplemented();
 701 NOTIMPLEMENTED();
691702 return ResourceError();
692703}
693704
694705ResourceError FrameLoaderClient::cannotShowURLError(const ResourceRequest&)
695706{
696  notImplemented();
 707 NOTIMPLEMENTED();
697708 return ResourceError();
698709}
699710
700711ResourceError FrameLoaderClient::interruptForPolicyChangeError(const ResourceRequest&)
701712{
702  notImplemented();
 713 NOTIMPLEMENTED();
703714 return ResourceError();
704715}
705716
706717ResourceError FrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse&)
707718{
708  notImplemented();
 719 NOTIMPLEMENTED();
709720 return ResourceError();
710721}
711722
712723ResourceError FrameLoaderClient::fileDoesNotExistError(const ResourceResponse&)
713724{
714  notImplemented();
 725 NOTIMPLEMENTED();
715726 return ResourceError();
716727}
717728
718729bool FrameLoaderClient::shouldFallBack(const ResourceError&)
719730{
720  notImplemented();
 731 NOTIMPLEMENTED();
721732 return false;
722733}
723734

728739
729740Frame* FrameLoaderClient::dispatchCreatePage()
730741{
731  notImplemented();
 742 NOTIMPLEMENTED();
732743 return 0;
733744}
734745
735746void FrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&)
736747{
737  notImplemented();
 748 NOTIMPLEMENTED();
738749}
739750
740751void FrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError& error)

748759
749760void FrameLoaderClient::startDownload(const ResourceRequest&)
750761{
751  notImplemented();
 762 NOTIMPLEMENTED();
752763}
753764
754765void FrameLoaderClient::updateGlobalHistory(const KURL&)
755766{
756  notImplemented();
 767 NOTIMPLEMENTED();
757768}
758769
759770void FrameLoaderClient::savePlatformDataToCachedPage(CachedPage*)

webkit-1.0.1/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h

9797 virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>);
9898 virtual void cancelPolicyCheck();
9999
 100 virtual void dispatchWillLoadImage(const WebCore::String &uri);
 101
100102 virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&);
101103
102104 virtual void dispatchWillSubmitForm(WebCore::FramePolicyFunction, WTF::PassRefPtr<WebCore::FormState>);

webkit-1.0.1/WebKit/gtk/webkit/webkitwebview.cpp

4040#include "ContextMenuController.h"
4141#include "Cursor.h"
4242#include "Document.h"
 43#include "DocLoader.h"
4344#include "DragClientGtk.h"
4445#include "Editor.h"
4546#include "EditorClientGtk.h"

8990 COPY_CLIPBOARD,
9091 PASTE_CLIPBOARD,
9192 CUT_CLIPBOARD,
 93 IMAGE_REQUESTED,
9294 LAST_SIGNAL
9395};
9496

927929 G_TYPE_STRING,
928930 G_TYPE_STRING);
929931
 932
 933 webkit_web_view_signals[IMAGE_REQUESTED] = g_signal_new("image-requested",
 934 G_TYPE_FROM_CLASS(webViewClass),
 935 (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
 936 0,
 937 NULL,
 938 NULL,
 939 webkit_marshal_VOID__STRING,
 940 G_TYPE_NONE, 1,
 941 G_TYPE_STRING );
 942
930943 /**
931944 * WebKitWebView::populate-popup:
932945 * @web_view: the object on which the signal is emitted

16821695 webkit_web_view_load_string(webView, content, NULL, NULL, baseUri);
16831696}
16841697
 1698void webkit_web_view_load_img(WebKitWebView* webView, const gchar* baseUri, const gchar*fname )
 1699{
 1700 Frame* frame = core(webView)->mainFrame();
 1701 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::createWithContentsOfFile( String(fname) );
 1702
 1703 frame->document()->docLoader()->loadResource( String(baseUri), sharedBuffer );
 1704}
 1705
16851706void webkit_web_view_stop_loading(WebKitWebView* webView)
16861707{
16871708 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));

webkit-1.0.1/WebKit/gtk/webkit/webkitwebview.h

152152webkit_web_view_stop_loading (WebKitWebView *web_view);
153153
154154WEBKIT_API void
 155webkit_web_view_load_img(WebKitWebView* webView, const gchar* baseUri, const gchar*fname );
 156
 157WEBKIT_API void
155158webkit_web_view_open (WebKitWebView *web_view,
156159 const gchar *uri);
157160