Last Comment Bug 124465 - [meta] freeze specific necko APIs for mozilla 1.0
: [meta] freeze specific necko APIs for mozilla 1.0
Status: VERIFIED FIXED
[adt3]
: arch, embed, topembed-
Product: Core
Classification: Components
Component: Networking (show other bugs)
: Trunk
: All All
: P3 major (vote)
: mozilla1.0
Assigned To: Darin Fisher
: benc
:
Mentors:
Depends on: 124030 124031 128508 128509
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-08 13:38 PST by Darin Fisher
Modified: 2002-07-16 13:41 PDT (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
preliminary final patch (minus required mac project changes) (123.82 KB, patch)
2002-04-10 17:39 PDT, Darin Fisher
no flags Details | Diff | Splinter Review
same changes w/o the nsC*.h files (minus mac project changes) (75.15 KB, patch)
2002-04-16 22:58 PDT, Darin Fisher
no flags Details | Diff | Splinter Review
interfaces to be frozen (56.69 KB, text/plain)
2002-04-16 23:04 PDT, Darin Fisher
no flags Details
final patch (88.17 KB, patch)
2002-05-03 00:57 PDT, Darin Fisher
no flags Details | Diff | Splinter Review

Description Darin Fisher 2002-02-08 13:38:35 PST
[meta] freeze specific necko APIs for mozilla 1.0
Comment 1 Darin Fisher 2002-02-08 13:40:49 PST
can someone please list the full set of necko APIs that must be frozen for
mozilla 1.0... i already have the following under way:

  nsIRequest
  nsIURI
  nsIURL

and i believe these are also important:

  nsILoadGroup
  nsIHttpChannel (cringe!)

are there others?
Comment 2 Judson Valeski 2002-02-08 13:43:34 PST
dougt has the latest cut at this list.
Comment 3 Darin Fisher 2002-02-08 13:46:19 PST
nsIRequestObserver needs to be added to this list as well.

there's also been some talk about freezing nsIProtocolHandler and nsIChannel. 
do we really want to freeze these for moz 1.0?
Comment 4 Bradley Baetz (:bbaetz) 2002-02-27 23:32:43 PST
If you freeze nsIChannel, then maybe Open should be on a separate, nonfrozen,
interface? Do any of our current protocols support syncronous opening?
Comment 5 Doug Turner (:dougt) 2002-02-28 07:52:01 PST
that is what darin and I discussed a few times, but there are callers that want
to open a resource synchronously. We shouldn't minimize the API because a few
callers (noted the big ones) don't implement it.
Comment 6 Darin Fisher 2002-02-28 11:09:36 PST
file, jar, and resource implement nsIChannel::Open

this is because these protocols can easily return a stream to file.
Comment 7 Bradley Baetz (:bbaetz) 2002-02-28 12:01:10 PST
No, but you could make an nsISynchronousChannel. I just get a bad feeling abuot
freezing behaviour that most of the protocol handlers don't implement - who
actually calls Open on those protocols?
Comment 8 Doug Turner (:dougt) 2002-02-28 12:03:50 PST
there is NO reason why a protocol can not support open().  it is a bug that http
and ftp do not support it.  
Comment 9 Darin Fisher 2002-02-28 12:05:50 PST
some RDF and maybe XBL resources are loaded synchronously at startup.  there
have always been plans to support sync HTTP ... it just got severely delayed.
Comment 10 Darin Fisher 2002-03-01 13:23:05 PST
adding dependency bugs for nsIChannel and nsIProtocolHandler, since these will
most likely freeze whether we mark them as frozen or not :(
Comment 11 rbs 2002-03-19 15:08:37 PST
Probably too late, but the names |nsIRequest| / |nsIChannel| have always seemed 
to be too generic to me (e.g., they give the impression of being pretty much in 
the same category as |nsISupports|).

[Alternatives could perhaps have been |nsIConnectRequest|, |nsIConnectChannel|]
Comment 12 Darin Fisher 2002-03-19 15:17:01 PST
i'd agree that the names are a bit overly generic, but i'd also agree that it is
late in the game... so, no love probably :(
Comment 13 Darin Fisher 2002-03-20 12:54:13 PST
adding nsIInputStream and nsIOutputStream to the interfaces being tracked by
this bug... i'll stamp them all FROZEN at the same time.
Comment 14 rpotts (gone) 2002-03-20 15:55:07 PST
the name nsIRequest was meant to be generic.  currently, nsIRequests are used to 
represent 'async operations'.  these include layout reflows as well as network 
operations...  basically, an nsIRequest can be anything that is asynchronous and 
should be cancelable, etc...

that's why we tried to keep nsIRequest as generic as possible... nsIChannel is 
another story :-)  yeah, nsIChannel is kinda vague... but at this point i think 
we're just going to live with it...

-- rick
Comment 15 benc 2002-03-27 08:15:29 PST
What needs to be done to verify the interface freeze bugs? This sounds like a
classic 'whitebox/code' issue.
Comment 16 Chak Nanga 2002-03-27 08:34:22 PST
All that needs to be done is to make sure that frozen interfaces follow the
guidelines at http://www.mozilla.org/projects/embedding/HowToFreeze.html

In addition to proper comments, they should be marked with "@status FROZEN" keyword.
Comment 17 Darin Fisher 2002-04-04 15:07:52 PST
i'll be updating the IIDs of all the necko interfaces that i have touched before
marking them frozen.  this will help avoid binary conflicts with 3rd party code
that references the old interfaces.
Comment 18 Darin Fisher 2002-04-10 17:39:26 PDT
Created attachment 78659 [details] [diff] [review]
preliminary final patch (minus required mac project changes)
Comment 19 Bradley Baetz (:bbaetz) 2002-04-10 18:07:14 PDT
Why the nsC* stuff? Can't they all go in one combined header file, such that the
header file itsself isn't frozen, but the stuff in there will continue to be the
same? You could have a spearate header file for frozen vs non frozen interfaces
if you want. Although we're only freezing contract ids, not classids anyway,
aren't we, since we're freezing interfaces, not concrete implementation.
Comment 20 Darin Fisher 2002-04-11 10:06:02 PDT
bbaetz: take a look at the bottom of this document:
http://www.mozilla.org/projects/embedding/HowToFreeze.html

  For each frozen service or public component create a corresponding header 
  file which has the following:

  1. #includes for each of the interfaces it supports. This allows consumers to 
  simply include the 'component' header file when using
  a component without having to explicitly include all of the interface   
  headers...

  2. Definition of the Contract-id (and Class-id if necessary) for the 
  component instance.

  3. Documentation about the component[Please follow the guidelines in "How to   
  mark an interface as frozen"
  mentioned above as applicable]

  4. Any other component specific code and/or defines.
Comment 21 Darin Fisher 2002-04-11 10:07:00 PDT
nsC* is the convention for these header files.
Comment 22 Doug Turner (:dougt) 2002-04-11 15:23:48 PDT
Comment on attachment 78659 [details] [diff] [review]
preliminary final patch (minus required mac project changes)

You created a lot of nsCFoo.h files which contain the ContractID, CID, and
class name.  Did you think about just having one file which contains all of
these declarations?  Do we really need seperate files?	

do we really have to have this warrning in the nsIChannel interface:

+     * method.  Moreover, since this method may block the calling thread, it
+     * should not be called on a thread that processes UI events.

in the nsIRequestObserver, you should also assert that onStart and onStop are
*always* paired.

This comment scares me:
+     * An exception thrown from onStopRequest is generally ignored.

When is it not ignored?  

the changes you had to make are minor and I am okay with them.	However, I
still wanna review the all of the complete interfaces which you are freezeing. 
Could you tar up all of the frozen interfaces and attach them.	This way, I can
comment on the complete interface a bit easier than sorting through this
unified diff :-)
Comment 23 Darin Fisher 2002-04-11 15:38:49 PDT
1- nsCFoo is "the way to freeze a component" no?  chak, valeski?

2- we don't need to have the warning i suppose, but it certainly should be
documented somewhere, wouldn't you agree?  what better place then nsIChannel.idl?

3- i'll add a comment to nsIRequestObserver about onStart/onStop always being
paired.

4- hmm, yeah.. i suppose i should say that an exception resulting from
OnStopRequest may be ignored (e.g., it will not result in a call to
nsIRequest::cancel).

5- sure, i'll attach a tarball of the revised interfaces.
Comment 24 Darin Fisher 2002-04-16 22:58:13 PDT
Created attachment 79579 [details] [diff] [review]
same changes w/o the nsC*.h files (minus mac project changes)
Comment 25 Darin Fisher 2002-04-16 23:04:33 PDT
Created attachment 79581 [details]
interfaces to be frozen
Comment 26 Darin Fisher 2002-04-16 23:07:13 PDT
i still need to address points 3 and 4 from comment #23
Comment 27 Darin Fisher 2002-04-18 16:33:27 PDT
given that this latest patch doesn't add any nsC*.h files, does anyone have any
other concerns that need to be addressed by this patch?

dougt, bbaetz: i'd really appreciate it if you two could review this patch.  thx!
Comment 28 Bradley Baetz (:bbaetz) 2002-04-22 09:21:16 PDT
Comment on attachment 79581 [details]
interfaces to be frozen

>netwerk/base/public/nsIChannel.idl:

>	/**
>	 * This flag is set to indicate that onStopRequest may be followed by
>     * another onStartRequest/onStopRequest pair.  This flag is, for example,
>     * used by the multipart/replace stream converter.
>	 */
>	const unsigned long LOAD_REPLACE = 1 << 18;

tabs... You have these in a few other places, too

>};

<nsIProtocolHandler>

>interface nsIProtocolHandler : nsISupports
>{
>    /**
>     * The scheme of this protocol (e.g., "file").
>     */
>    readonly attribute ACString scheme;
>
>    /** 
>     * The default port is the port that this protocol normally uses.
>     * If a port does not make sense for the protocol (e.g., "about:")
>     * then -1 will be returned.
>     */
>    readonly attribute long defaultPort;
>
>    /**
>     * Returns the protocol specific flags (see flag definitions below).  
>     */
>    readonly attribute unsigned long protocolFlags;

This is going to be semi-controversial (I remember the last time it was brought
up, late last year):

"Implementations MUST ignore any flags they do not understand."

this allows us to add a new flag later, provided that implementations which
don't
understand the flag are unchanged.

OTOH, that disucssions sort of tapered off, rather than arrive at a conclusion.

Maybe we should add the comment anyway (since doing so is good programming
practice, and won't hurt),
and keep the arguments until we actually need/want to..


>interface nsIRequest : nsISupports
>{
>    /**
>     * The name of the request.  Often this is the URI of the request.
>     */
>    readonly attribute AUTF8String name;
>
>    /**
>     * @return TRUE if the request has yet to reach completion.
>     * @return FALSE if the request has reached completion (e.g., after
>     *   OnStopRequest has fired).
>     * Suspended requests are still considered pending.
>     */
>    boolean isPending();

Why isn't this a readonly attribute?

>

>netwerk/base/public/nsIURI.idl:
>
>%{C++
>#undef GetPort  // XXX Windows!
>#undef SetPort  // XXX Windows!
>%}

That looks rather, um, fragile. Can we do better, somehow?

>interface nsIURI : nsISupports
>{
>    /**
>     * An optimization to do scheme checks without requiring the users of nsIURI
>     * to GetScheme, thereby saving extra allocating and freeing. Returns true if
>     * the schemes match (case ignored).
>     */

Would this be better off as an |in nsAUTF8String| (Actually, scheme names are
always ASCII, aren't
they?

>    boolean schemeIs(in string scheme);
>


We're not freezing nsIFileURL, correct?


[nsIInputStream & nsIOutputStream]

>    /**
>     * @return true if stream is non-blocking
>     */
>    boolean isNonBlocking();

Why isn't this a readonly attribute (in both cases)
Comment 29 scottputterman 2002-04-22 19:32:56 PDT
Changing nsbeta1+ [adt3] bugs to nsbeta1- on behalf of the adt.  If you have any
questions about this, please email adt@netscape.com.  You can search for
"changing adt3 bugs" to quickly find and delete these bug mails.
Comment 30 scottputterman 2002-04-22 19:58:30 PDT
Changing nsbeta1+ [adt3] bugs to nsbeta1- on behalf of the adt.  If you have any
questions about this, please email adt@netscape.com.  You can search for
"changing adt3 bugs" to quickly find and delete these bug mails.
Comment 31 Darin Fisher 2002-04-22 20:32:19 PDT
bbaetz: thx for reviewing the patch...

1- will fix the indentation problems

2- agreed... will add that comment to the patch

3- already had the argument over isNonBlocking... isPending follows suite.  i
personally prefer IsPending() over GetIsPending().  see the discussion in bug
99165 if you're interested.  anyways, i don't want to change the binary
signature of these interfaces at this point.  looks like it's going to be hard
enough to convince ADT to accept this patch on the branch... wouldn't want there
to be actual code changes muddling the picture ;-)  ...all kidding aside, let's
not break binary compatibility _again_ if we can help it... apparently, there
are plugin vendors using these interfaces.

4- #if defined(XP_WIN) && defined(GetPort) ?!  heck, we've lived with this for a
long time... why change it now?

5- RFC2396 defines an URL scheme as a subset of ASCII.

6- we could freeze nsIFileURL but no one has frankly asked for it.  anyways,
i've never liked the fact that you can QI nsStandardURL to nsIFileURL when it
doesn't make sense.  was hoping to one day remedy that by adding an
initialization flag to nsIStandardURL::Init.  until something like that happens,
we'll always have to explain to people that QI'ing to nsIFileURL is not enough
to determine that it is a file:// URL, which greatly confuses most necko newbies.
Comment 32 Asa Dotzler [:asa] 2002-04-24 16:05:24 PDT
mozilla1.0 needs this. adding a plus.
Comment 33 Dave Barrowman 2002-04-29 09:30:57 PDT
Marking topembed-, embed per EDT triage.
Comment 34 Darin Fisher 2002-05-01 20:44:56 PDT
FYI: these "comment changes" (plus revisions for bbaetz's points #1 and #2) are
landing sometime tomorrow on both the trunk and the 1.0 branch.
Comment 35 Darin Fisher 2002-05-03 00:57:54 PDT
Created attachment 82179 [details] [diff] [review]
final patch
Comment 36 Darin Fisher 2002-05-03 00:58:51 PDT
ok, times up... landed this patch on the trunk.
Comment 37 Darin Fisher 2002-05-05 14:01:13 PDT
landed on branch, marking FIXED
Comment 38 Asa Dotzler [:asa] 2002-05-05 14:49:42 PDT
adding branch resolution keyword.
Comment 39 benc 2002-07-16 13:41:49 PDT
VERIFIED: +1.0.0
If there are further concerns, please reopen.

Note You need to log in before you can comment on or make changes to this bug.