RESOLVED FIXED 47394
[chromium] Update ReadableDataObject/WritableDataObject interface for ChromiumDataObject change
https://bugs.webkit.org/show_bug.cgi?id=47394
Summary [chromium] Update ReadableDataObject/WritableDataObject interface for Chromiu...
Daniel Cheng
Reported 2010-10-07 19:16:16 PDT
1. Condensing getURL()/setURL()/getHTML()/setHTML()/urlTitle()/htmlBaseURL() into urlTitle()/htmlBaseURL() and the corresponding setters. 2. Use ClipboardType instead of bools.
Attachments
Patch (11.12 KB, patch)
2010-10-07 19:54 PDT, Daniel Cheng
tony: review-
Patch (12.98 KB, patch)
2010-10-08 15:35 PDT, Daniel Cheng
no flags
Daniel Cheng
Comment 1 2010-10-07 19:54:26 PDT
Tony Chang
Comment 2 2010-10-08 10:10:29 PDT
Comment on attachment 70196 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=70196&action=review > WebCore/platform/chromium/ReadableDataObject.h:54 > - virtual String getHTML(String* baseURL) const; > + String urlTitle() const; > + KURL htmlBaseUrl() const; I prefer the getHTML method because it makes the caller think about whether they need the base url or not. I feel less strongly about the getURL method, but it's pretty easy to pass in NULL for the title so I'm not sure there's much benefit to splitting it up. > WebCore/platform/chromium/WritableDataObject.h:59 > - virtual void setURL(const String& url, const String& title); > - virtual void setHTML(const String& html, const KURL& baseURL); > + void setUrlTitle(const String& title); > + void setHtmlBaseUrl(const KURL& baseURL); I prefer the old API where you can set everything in a single function call. It makes it less likely that someone forgets to call setUrlTitle or setHtmlBaseUrl. Also, in webkit, we tend to capitalize URL (e.g., KURL) and HTML (e.g., all the files in WebCore/html/). > WebCore/platform/chromium/WritableDataObject.h:64 > virtual String urlTitle() const; > virtual KURL htmlBaseURL() const; Are these methods actually called? Do they need to be virtual?
Daniel Cheng
Comment 3 2010-10-08 15:35:21 PDT
Created attachment 70302 [details] Patch (In reply to comment #2) > (From update of attachment 70196 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=70196&action=review > > > WebCore/platform/chromium/ReadableDataObject.h:54 > > - virtual String getHTML(String* baseURL) const; > > + String urlTitle() const; > > + KURL htmlBaseUrl() const; > > I prefer the getHTML method because it makes the caller think about whether they need the base url or not. I feel less strongly about the getURL method, but it's pretty easy to pass in NULL for the title so I'm not sure there's much benefit to splitting it up. > > > WebCore/platform/chromium/WritableDataObject.h:59 > > - virtual void setURL(const String& url, const String& title); > > - virtual void setHTML(const String& html, const KURL& baseURL); > > + void setUrlTitle(const String& title); > > + void setHtmlBaseUrl(const KURL& baseURL); > > I prefer the old API where you can set everything in a single function call. It makes it less likely that someone forgets to call setUrlTitle or setHtmlBaseUrl. Also, in webkit, we tend to capitalize URL (e.g., KURL) and HTML (e.g., all the files in WebCore/html/). > > > WebCore/platform/chromium/WritableDataObject.h:64 > > virtual String urlTitle() const; > > virtual KURL htmlBaseURL() const; > > Are these methods actually called? Do they need to be virtual? They are called, but I forgot to devirtualize them. They are used when copying data from WebKit to the browser host. I also went ahead and inlined all the simple setters/getters into the header.
WebKit Commit Bot
Comment 4 2010-10-08 16:13:49 PDT
Comment on attachment 70302 [details] Patch Clearing flags on attachment: 70302 Committed r69431: <http://trac.webkit.org/changeset/69431>
WebKit Commit Bot
Comment 5 2010-10-08 16:13:54 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.