Bug 17640

Summary: eliminate WebCoreFrameBridge
Product: WebKit Reporter: Darin Adler <darin>
Component: WebCore Misc.Assignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
eliminate the WebCore -> WebKit half of the bridge
none
smaller piece for Adam to review
none
work in progress (ready to land, but needs to be broken in pieces for review)
none
patch for just issuePasteCommand
none
patch for just dashboardRegionsChanged
none
patch moving code from the bridge to frame loader client on the WebKit side
none
patch for just window method
none
patch for just installInFrame method
none
patch for scrollOverflow method
none
patch for createFrameView method
none
patch for reapplyStyles method
none
work in progress
none
patch for runOpenPanel
none
patch for custom highlight calls
none
patch that moves Java applet loading off the bridge
none
patch that moves keyboard mode off the bridge
none
patch that removes the rest of the WebKit -> WebCore bridge
none
patch that removes use of the bridge to go from an NSView to a WebCore::Frame
none
revised patch that removes use of the bridge to go from an NSView to a WebCore::Frame
none
patch that removes every last use of the bridge in WebCore
none
patch that drives a stake through the heart of the bridge andersca: review+

Description Darin Adler 2008-03-02 12:42:40 PST
We need to get rid of the bridge.
Comment 1 Darin Adler 2008-03-02 13:18:11 PST
Created attachment 19485 [details]
eliminate the WebCore -> WebKit half of the bridge
Comment 2 Adam Roben (:aroben) 2008-03-03 06:37:15 PST
Comment on attachment 19485 [details]
eliminate the WebCore -> WebKit half of the bridge

There's a whole lotta patch here! Any chance we can get this broken up and reviewed/landed incrementally?
Comment 3 Darin Adler 2008-03-03 09:25:11 PST
(In reply to comment #2)
> There's a whole lotta patch here! Any chance we can get this broken up and
> reviewed/landed incrementally?

Sure, it could be broken up into 2 pieces, or 10, or 30.
Comment 4 Darin Adler 2008-03-03 10:38:38 PST
Created attachment 19496 [details]
smaller piece for Adam to review
Comment 5 Adam Roben (:aroben) 2008-03-03 10:43:39 PST
Comment on attachment 19496 [details]
smaller piece for Adam to review

r=me
Comment 6 Darin Adler 2008-03-03 10:48:20 PST
Comment on attachment 19496 [details]
smaller piece for Adam to review

Landed.
Comment 7 Darin Adler 2008-03-03 10:48:50 PST
Created attachment 19497 [details]
work in progress (ready to land, but needs to be broken in pieces for review)
Comment 8 Darin Adler 2008-03-04 03:25:48 PST
Created attachment 19515 [details]
patch for just issuePasteCommand
Comment 9 Darin Adler 2008-03-04 03:59:58 PST
Created attachment 19517 [details]
patch for just dashboardRegionsChanged
Comment 10 Darin Adler 2008-03-04 04:11:31 PST
Created attachment 19518 [details]
patch moving code from the bridge to frame loader client on the WebKit side
Comment 11 Darin Adler 2008-03-04 04:16:03 PST
Created attachment 19519 [details]
patch for just window method
Comment 12 Darin Adler 2008-03-04 04:33:42 PST
Created attachment 19520 [details]
patch for just installInFrame method
Comment 13 Darin Adler 2008-03-04 04:42:33 PST
Created attachment 19521 [details]
patch for scrollOverflow method
Comment 14 Darin Adler 2008-03-04 04:52:15 PST
Created attachment 19522 [details]
patch for createFrameView method
Comment 15 Darin Adler 2008-03-04 05:01:13 PST
Created attachment 19523 [details]
patch for reapplyStyles method
Comment 16 Adam Roben (:aroben) 2008-03-04 06:31:23 PST
Comment on attachment 19515 [details]
patch for just issuePasteCommand

r=me
Comment 17 Adam Roben (:aroben) 2008-03-04 06:33:12 PST
Comment on attachment 19517 [details]
patch for just dashboardRegionsChanged

r=me
Comment 18 Adam Roben (:aroben) 2008-03-04 06:46:43 PST
Comment on attachment 19518 [details]
patch moving code from the bridge to frame loader client on the WebKit side

This patch seems to be missing the removal of the implementation of -[WebFrameBridge windowObjectCleared]

Other than that, r=me
Comment 19 Adam Roben (:aroben) 2008-03-04 06:47:29 PST
Comment on attachment 19519 [details]
patch for just window method

r=me
Comment 20 Adam Roben (:aroben) 2008-03-04 06:49:24 PST
Comment on attachment 19520 [details]
patch for just installInFrame method

r=me
Comment 21 Adam Roben (:aroben) 2008-03-04 06:50:41 PST
Comment on attachment 19521 [details]
patch for scrollOverflow method

r=me
Comment 22 Adam Roben (:aroben) 2008-03-04 06:51:34 PST
Comment on attachment 19522 [details]
patch for createFrameView method

r=me
Comment 23 Adam Roben (:aroben) 2008-03-04 06:52:15 PST
Comment on attachment 19523 [details]
patch for reapplyStyles method

r=me
Comment 24 Darin Adler 2008-03-04 07:19:20 PST
Comment on attachment 19515 [details]
patch for just issuePasteCommand

Landed.
Comment 25 Darin Adler 2008-03-04 07:19:35 PST
Comment on attachment 19496 [details]
smaller piece for Adam to review

Landed.
Comment 26 Darin Adler 2008-03-04 07:19:49 PST
Comment on attachment 19517 [details]
patch for just dashboardRegionsChanged

Landed.
Comment 27 Darin Adler 2008-03-04 07:20:05 PST
Comment on attachment 19518 [details]
patch moving code from the bridge to frame loader client on the WebKit side

Landed.
Comment 28 Darin Adler 2008-03-04 07:20:59 PST
Comment on attachment 19519 [details]
patch for just window method

Landed.
Comment 29 Darin Adler 2008-03-04 07:22:30 PST
Comment on attachment 19520 [details]
patch for just installInFrame method

Landed.
Comment 30 Darin Adler 2008-03-04 07:25:34 PST
Comment on attachment 19521 [details]
patch for scrollOverflow method

Landed.
Comment 31 Darin Adler 2008-03-04 07:30:05 PST
Comment on attachment 19522 [details]
patch for createFrameView method

Landed.
Comment 32 Darin Adler 2008-03-04 07:35:21 PST
Comment on attachment 19523 [details]
patch for reapplyStyles method

Landed.
Comment 33 Darin Adler 2008-03-04 07:41:06 PST
Created attachment 19524 [details]
work in progress
Comment 34 Darin Adler 2008-03-04 08:54:46 PST
Created attachment 19525 [details]
patch for runOpenPanel
Comment 35 Adam Roben (:aroben) 2008-03-05 10:22:53 PST
Comment on attachment 19525 [details]
patch for runOpenPanel

+void ChromeClient::runOpenPanel(PassRefPtr<FileChooser>)
+{
+}

Why is this empty implementation needed in ChromeMac.mm? Can't you make this method declaration pure virtual and just have WebChromeClient implement it?

r=me regardless
Comment 36 Darin Adler 2008-03-07 12:44:54 PST
(In reply to comment #35)
> Why is this empty implementation needed in ChromeMac.mm? Can't you make this
> method declaration pure virtual and just have WebChromeClient implement it?

I could, but then I'd have to add code to the "SVG empty clients". I'm really not sure what the best design for this is going forward, but for now I'm not going to make this pure virtual.
Comment 37 Darin Adler 2008-03-07 13:02:16 PST
Comment on attachment 19525 [details]
patch for runOpenPanel

Clearing review flag since I committed revision 30875.
Comment 38 Darin Adler 2008-03-07 19:41:30 PST
Created attachment 19606 [details]
patch for custom highlight calls
Comment 39 Darin Adler 2008-03-08 06:11:05 PST
Comment on attachment 19606 [details]
patch for custom highlight calls

Committed revision 30900.
Comment 40 Darin Adler 2008-03-08 07:17:40 PST
Created attachment 19609 [details]
patch that moves Java applet loading off the bridge
Comment 41 Darin Adler 2008-03-08 07:29:35 PST
Created attachment 19610 [details]
patch that moves keyboard mode off the bridge
Comment 42 Sam Weinig 2008-03-10 08:37:02 PDT
Comment on attachment 19609 [details]
patch that moves Java applet loading off the bridge

I am really not sure what is the correct possition for the * here, but since the following line has it next to the type, also for an ObjC type, it would be nice to be consistent.

 #if PLATFORM(MAC)
+        virtual jobject javaApplet(NSView *) { return 0; }
          virtual NSCachedURLResponse* willCacheResponse(DocumentLoader*, unsigned long identifier, NSCachedURLResponse*) const = 0;

r=me
Comment 43 Sam Weinig 2008-03-10 08:49:36 PDT
Comment on attachment 19610 [details]
patch that moves keyboard mode off the bridge

I am not too crazy about having ChromeClient implementations in ChromeMac.mm, but I assume it is to get around having to implement it for the SVGImageEmptyClient.  If that is the case, we should have a new file, perhaps ChromeClientMac.mm, to contain these base implementations.

Could you also explain in the changelog why it is okay to remove 
-    ASSERT_MAIN_THREAD();
from the finalize method of WebFrameBridge.

r=me
Comment 44 Darin Adler 2008-03-10 09:40:16 PDT
(In reply to comment #43)
> I am not too crazy about having ChromeClient implementations in ChromeMac.mm,
> but I assume it is to get around having to implement it for the
> SVGImageEmptyClient.

Sure, that's right. Not just for SVGImage, but in general to have a policy of default behavior rather than not compiling if you choose not to implement one of the client functions. I'm not completely sure whether pure virtual functions or functions with a default implementation are best.

> If that is the case, we should have a new file, perhaps
> ChromeClientMac.mm, to contain these base implementations.

Sure, I will create a new file.

> Could you also explain in the changelog why it is okay to remove 
> -    ASSERT_MAIN_THREAD();
> from the finalize method of WebFrameBridge.

Yes.
Comment 45 Darin Adler 2008-03-10 10:02:35 PDT
Comment on attachment 19609 [details]
patch that moves Java applet loading off the bridge

Committed revision 30935.
Comment 46 Darin Adler 2008-03-10 10:38:52 PDT
Comment on attachment 19610 [details]
patch that moves keyboard mode off the bridge

Committed revision 30939.
Comment 47 Darin Adler 2008-03-10 22:13:06 PDT
Created attachment 19656 [details]
patch that removes the rest of the WebKit -> WebCore bridge
Comment 48 Darin Adler 2008-03-11 12:34:43 PDT
Created attachment 19674 [details]
patch that removes use of the bridge to go from an NSView to a WebCore::Frame
Comment 49 Darin Adler 2008-03-11 14:34:59 PDT
Created attachment 19677 [details]
revised patch that removes use of the bridge to go from an NSView to a WebCore::Frame
Comment 50 Darin Adler 2008-03-11 17:52:12 PDT
Comment on attachment 19656 [details]
patch that removes the rest of the WebKit -> WebCore bridge

Committed revision 30975.
Comment 51 Anders Carlsson 2008-03-11 18:22:34 PDT
Comment on attachment 19677 [details]
revised patch that removes use of the bridge to go from an NSView to a WebCore::Frame

r=me
Comment 52 Darin Adler 2008-03-11 18:25:44 PDT
Comment on attachment 19677 [details]
revised patch that removes use of the bridge to go from an NSView to a WebCore::Frame

Committed revision 30976.
Comment 53 Darin Adler 2008-03-11 20:35:18 PDT
Created attachment 19693 [details]
patch that removes every last use of the bridge in WebCore
Comment 54 Sam Weinig 2008-03-11 20:40:44 PDT
Comment on attachment 19693 [details]
patch that removes every last use of the bridge in WebCore

r=me. YEAH!
Comment 55 Darin Adler 2008-03-11 22:29:38 PDT
Comment on attachment 19693 [details]
patch that removes every last use of the bridge in WebCore

Committed revision 30980.
Comment 56 Darin Adler 2008-03-12 10:03:04 PDT
Created attachment 19700 [details]
patch that drives a stake through the heart of the bridge
Comment 57 Anders Carlsson 2008-03-12 10:17:58 PDT
Comment on attachment 19700 [details]
patch that drives a stake through the heart of the bridge

r=me
Comment 58 Darin Adler 2008-03-12 11:47:14 PDT
I can't land this until I get home tonight, because I saw at least one crash running regression tests. It should be trivial to fix.

So Hyatt, feel free to land your patch. I'll merge with it.
Comment 59 Darin Adler 2008-03-12 20:49:26 PDT
Committed revision 31014.