Search completed in 0.93 seconds.
Implementing Download Resuming
the interfaces in question exist in the form they are described here since gecko 1.8a4 (firefox 1.5, seamonkey 1.0, xulrunner 1.8.0.1). introduction various protocols support getting partial files. this means that if a download was interrupted, it can be resumed from that point on, rather than regetting the whole file. the necko implementations of http 1.1 (rfc 2616) as well as ftp support this feature. ...
... support this feature. not only is the ability to specify a start position important, but it's also important to have some assurance that the file did not change since the initial download attempt. that would lead to a situation where the first part of the file corresponds to the initial version, while the latter part belongs to a different version, leading to an unusable result. the interface
resuming is done using the nsiresumablechannel interface. the expected way to use it is this: for all downloads that happen, get the entityid from the channel, and store it for later use. the entity id is what ensures that the file remains unchanged. this can also be used to check whether the download is resumable: if it is not (e.g. the server is not using http 1.1), then accessing this attribute will...
...mable: if it is not (e.g. the server is not using http 1.1), then accessing this attribute will throw an ns_error_not_resumable exception. if the download gets interrupted, necko will call the stream listener's onstoprequest method with a failure status. (todo: document what webbrowserpersist/exthandler do). the front-end code can then notify the user of this, and offer to resume the download.
resuming a download in order to resume a download, you should create a channel as usual (using nsiioservice). then, you can check if it implements nsiresumablechannel. if it does not, the protocol does not support
resuming. otherwise, call resumeat with the desired start position, and the previously stored entity id. (it is possible to pass an empty string as the id; however, this means that you have no ...
...st cannot append to existing files (as opposed to overwriting them), and is therefore not usable for this task (see bug 129921). detecting when a file changed if the file changed (that is, the entity id does not match), then necko will notify the stream listener with an ns_error_entity_changed error code. the front-end may want to offer the user to get the new file from scratch in such a case.
resuming not supported in some cases, it's not possible to detect whether the server supports
resuming until the user actually tries to resume. in such a case, the stream listener will get an ns_error_not_resumable status. here, too, the front-end may want to offer downloading the entire file from scratch. ...
Bytecode Descriptions
and return to the caller. when a generator is called, its script starts running, like any other js function, because functiondeclarationinstantation and other generator object setup are implemented mostly in bytecode. however, the functionbody of the generator is not supposed to start running until the first .next() call, so after setup the script suspends itself: the "initial yield". later, when
resuming execution, rval, gen and resumekind will receive the values passed in by jsop::resume. resumekind is the generatorresumekind stored as an int32 value. this instruction must appear only in scripts for generators and async generators. gen must be the generator object for the current frame. it must not have been previously suspended. the resume point indicated by resumeindex must be the next instruc...
...tion in the script, which must be afteryield. implements: generatorstart, steps 4-7. format: jof_resumeindex afteryield operands: (uint32_t icindex) bytecode emitted after yield expressions. this is useful for the debugger and abstractgeneratorobject::isafteryieldorawait. it's treated as jump target op so that the baseline interpreter can efficiently restore the frame's interpretericentry when
resuming a generator. the preceding instruction in the script must be yield, initialyield, or await. format: jof_icindex finalyieldrval stack: gen ⇒ suspend and close the current generator, async function, or async generator. gen must be the generator object for the current frame. if the current function is a non-async generator, then the value in the frame's return value slot is returned to the call...
...rval1 should be the value to yield, and the caller is responsible for creating the iterator result object (under js::asyncgeneratoryield). this instruction must appear only in scripts for generators and async generators. gen must be the generator object for the current stack frame. the resume point indicated by resumeindex must be the next instruction in the script, which must be afteryield. when
resuming execution, rval2, gen and resumekind receive the values passed in by jsop::resume. implements: generatoryield and asyncgeneratoryield. format: jof_resumeindex isgenclosing stack: val ⇒ val, res pushes a boolean indicating whether the top of the stack is magicvalue(js_generator_closing). asyncawait stack: value, gen ⇒ promise arrange for this async function to resume asynchronously when ...
nsIResumableChannel
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void asyncopenat(in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri. ...
...enat( in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid ); parameters listener as for asyncopen. ctxt as for asyncopen. startpos the starting offset, in bytes, to use to download. entityid information about the file, to match before obtaining the file. pass an empty string to use anything. resumeat() prepare this channel for
resuming. the request will not start until asyncopen or open is called. calling resumeat after open or asyncopen has been called has undefined behaviour. during onstartrequest, this channel will have a status of ns_error_not_resumable if the file cannot be resumed, for example because the server doesn't support this. this error may occur even if startpos is 0, so that the front end can warn the user. simi...
...es, no ondataavailable will be called, and onstoprequest will immediately follow with the same status code. void resumeat( in unsigned long long startpos, in acstring entityid ); parameters startpos the starting offset, in bytes, to use to download. entityid information about the file, to match before obtaining the file. pass an empty string to use anything. see also implementing download
resuming ...
HTTP conditional requests - HTTP
http has a concept of conditional requests, where the result, and even the success of a request, can be changed by comparing the affected resources with the value of a validator. such requests can be useful to validate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when
resuming a download, or when preventing to lose updates when uploading or modifying a document on the server. principles http conditional requests are requests that are executed differently, depending on the value of specific headers. these headers define a precondition, and the result of the request will be different if the precondition is matched or not. the different behaviors are defined by the method of the request used, and by the set of headers used for a precondition: ...
...s, and are of two kinds: the date of last modification of the document, the last-modified date. an opaque string, uniquely identifying each version, called the entity tag, or the etag. comparing versions of the same resource is a bit tricky: depending on the context, there are two kinds of equality checks: strong validation is used when byte to byte identity is expected, for example when
resuming a download. weak validation is used when the user-agent only needs to determine if the two resources have the same content. this is even if they are minor differences; like different ads, or a footer with a different date. the kind of validation is independent of the validator used. both last-modified and etag allow both types of validation, though the complexity to implement it on the server ...
...ag. the request will succeed, only if the resource didn't exist before: if-none-match will only work with http/1.1 (and later) compliant servers. if unsure if the server will be compliant, you need first to issue a head request to the resource to check this. conclusion conditional requests are a key feature of http, and allow the building of efficient and complex applications. for caching or
resuming downloads, the only work required for webmasters is to configure the server correctly; setting correct etags in some environments can be tricky. once achieved, the browser will serve the expected conditional requests. for locking mechanisms, it is the opposite: web developers need to issue a request with the proper headers, while webmasters can mostly rely on the application to carry out the che...
platform/xpcom - Archive of obsolete content
terfaces. for example, this subclass implements the nsirequest interface: var { class } = require('sdk/core/heritage'); var { unknown } = require('sdk/platform/xpcom'); var request = class({ extends: unknown, interfaces: [ 'nsirequest' ], initialize: function initialize() { this.pending = false; }, ispending: function() { return this.pending; }, resume: function() { console.log('
resuming...'); }, suspend: function() { console.log('suspending...'); }, cancel: function() { console.log('canceling...'); } }); this component definition: specifies that we support nsirequest using the interfaces property. initializes pending in initialize() adds our implementation of the nsirequest interface although request also implements nsisupports, there is no need to add it here, becau...
Index - Archive of obsolete content
added on the devmo talk:1.0 launch roadmap page. further details on smaller tasks being done are available at user:dria:todo page. see also current events. 423 download manager improvements in firefox 3 download manager, firefox 3 firefox 3 offers improvements to the download manager that allow multiple progress listeners, use of the storage api for data management, download
resuming, and more. in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanagerui interface. 424 download manager preferences there are several preferences used by the download manager. this article provides a list of them. 425 drag and drop mozilla, xul this section describes how to implement objects t...
Download Manager preferences - Archive of obsolete content
ox is run; 1 indicates that the downloads should be paused but will not automatically resume when the application is restarted; and 2 indicates that the downloads will be canceled on quit. default value is 0 (resume on next launch). browser.download.manager.resumeonwakedelay an integer value indicating the number of milliseconds to wait after the system wakes up from sleep before
resuming downloads. default value is 10000. browser.download.manager.retention indicates how long downloads are retained in the download manager's queue after the download is completed successfully. 0 indicates that the download should be removed upon completion; 1 indicates that completed and canceled downloads should be removed on quit; 2 indicates that downloads should never be removed aut...
Archived Mozilla and build documentation - Archive of obsolete content
should be added on the devmo talk:1.0 launch roadmap page. further details on smaller tasks being done are available at user:dria:todo page. see also current events. download manager improvements in firefox 3 firefox 3 offers improvements to the download manager that allow multiple progress listeners, use of the storage api for data management, download
resuming, and more. in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanagerui interface. download manager preferences there are several preferences used by the download manager. this article provides a list of them. drag and drop this section describes how to implement objects that can be dra...
PR_Wait
the state change ... pr_exitmonitor(&ml); a thread can be resumed from a wait for a variety of reasons. the most obvious is that it was notified by another thread. if the value of timeout is not pr_interval_no_timeout, pr_wait resumes execution after the specified interval has expired. if a timeout value is used, the boolean expression must include elapsed time as part of the monitored data.
resuming from the wait is merely an opportunity to evaluate the expression, not an assertion that the expression is true. ...
Web Replay
f the debug objects are only valid until the middleman notifies the child process that it can resume forward execution or must rewind to an earlier snapshot. when the child process pauses again (at a breakpoint, say) the debug objects must be reconstructed. there is an exception to this, for scripts and script source objects; debug objects for these will continue to hold the same referent after
resuming or rewinding the replaying process. this is necessary for script breakpoints to work, and is implemented by ensuring that the ordering of creation of scripts and script sources is deterministic (mainly by disabling off thread parsing, which is one of the behavior changes during recording/replay). the user's interface to the devtools for a child process is the same as for a normal content proces...
nsIRadioInterfaceLayer
jsval read only. obsolete since gecko 13.0 microphonemuted bool radiostate jsval read only. ...
Mozilla
firefox itself, such as a deadlock or infinite loop, or it may be caused by 3rd-party software such as a firefox extension, antivirus software, or even malware or a virus on your computer. http cache httpd.js ime handling guide this document explains how gecko handles ime. implementing download
resuming this document describes how an embedder or other gecko/necko-using application can implement download
resuming. implementing queryinterface this document describes the right way to write queryinterface(). infallible memory allocation there's ongoing work to implement infallible memory allocators. these are memory allocation routi...
Credential Management API - Web APIs
agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. to address these problems, the credential management api provides ways for a website to store and retrieve different types of credentials. this give users capabilities such as seeing the federated account they used to sign on to a site, or
resuming a session without the explicit sign-in flow of an expired session. this api is restricted to top-level contexts. calls to get() and store() within an <iframe> element will resolve without effect. subdomain-shared credentials later version of the spec allow credentials to be retrieved from a different subdomain. for example, a password stored in login.example.com may be used to log in to www.
Index - Web APIs
agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. to address these problems, the credential management api provides ways for a website to store and retrieve different types of credentials. this give users capabilities such as seeing the federated account they used to sign on to a site, or
resuming a session without the explicit sign-in flow of an expired session. 684 credentialscontainer api, credential management api, credentialscontainer, experimental, interface, needsexample, reference, credential management the credentialscontainer interface of the the credential management api exposes methods to request credentials and notify the user agent when events such as suc...
WebGLRenderingContext.isContextLost() - Web APIs
textlost() method returns a boolean indicating whether or not the webgl context has been lost and must be re-established before rendering can resume. syntax let islost = gl.iscontextlost(); return value a boolean which is true if the context is lost, or false if not. usage notes there are several reasons why a webgl context may be lost, making it necessary to re-establish the context before
resuming rendering. examples include: two or more pages are using the gpu, but together place too high a demand on the gpu, so the browser tells the two contexts that they've lost the connection, then selects one of the two to restore access for. the user's computer has multiple graphics processors (such as a laptop with both mobile and desktop class gpus, the former used primarily when on battery pow...
animation-play-state - CSS: Cascading Style Sheets
the animation-play-state css property sets whether an animation is running or paused. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence. syntax /* single animation */ animation-play-state: running; animation-play-state: paused; /* multiple animations */ animation-play-state: paused, running, running; /* global values */ animation-play-state: inherit; animation-play-state: initial; animation-play-state: unset; values running the animation is ...
Event reference
escriptexecute menu events dommenuitemactive dommenuiteminactive window events close popup events popuphidden popuphiding popupshowing popupshown tab events visibilitychange battery events chargingchange chargingtimechange dischargingtimechange levelchange call events alerting busy callschanged cfstatechange connecting dialing disconnected disconnecting error held, holding incoming
resuming statechange voicechange sensor events compassneedscalibration devicemotion deviceorientation orientationchange smartcard events icccardlockerror iccinfochange smartcard-insert smartcard-remove stkcommand stksessionend cardstatechange sms and ussd events delivered received sent ussdreceived frame events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserlo...
HTTP Index - HTTP
44 http conditional requests conditional requests, guide, http http has a concept of conditional requests, where the result, and even the success of a request, can be changed by comparing the affected resources with the value of a validator. such requests can be useful to validate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when
resuming a download, or when preventing to lose updates when uploading or modifying a document on the server. 45 http cookies advertising, browser, cookies, cookies article, guide, http, history, javascript, privacy, protocols, server, storage, web development, data, request, tracking an http cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user'...
HTTP range requests - HTTP
the if-range http request header makes a range request conditional: if the condition is fulfilled, the range request will be issued and the server sends back a 206 partial content answer with the appropriate body. if the condition is not fulfilled, ...
await - JavaScript
ait can split execution flow, allowing the caller of the await's function to resume execution before the deferred continuation of the await's function. after the await defers the continuation of its function, if this is the first await executed by the function, immediate execution also continues by returning to the function's caller a pending promise for the completion of the await's function and
resuming execution of that caller. examples awaiting a promise to be fulfilled if a promise is passed to an await expression, it waits for the promise to be fulfilled and returns the fulfilled value. function resolveafter2seconds(x) { return new promise(resolve => { settimeout(() => { resolve(x); }, 2000); }); } async function f1() { var x = await resolveafter2seconds(10); conso...
async function - JavaScript
of the function. the await mechanism may be used. return value a promise which will be resolved with the value returned by the async function, or rejected with an exception thrown from, or uncaught within, the async function. description async functions can contain zero or more await expressions. await expressions suspend progress through an async function, yielding control and subsequently
resuming progress only when an awaited promise-based asynchronous operation is either fulfilled or rejected. the resolved value of the promise is treated as the return value of the await expression. use of async / await enables the use of ordinary try / catch blocks around asynchronous code. the await keyword is only valid inside async functions. if you use it outside of an async function's body, you wi...