Building Firefox install
Hi, I've made some modifications to the Firefox source code and now I would like to build the install exe on Windows, so that i can normally install Firefox (I want to couple it with a crawler - http://crawljax.com/). However I would like that installation to be standard Firefox (and not nightly!; the crawler via selenium can establish communication with standard Firefox, even the portable one, but for some reason cannot with the Nightly version, even with the selenium supported version of Nightly). I've tried to add: ac_add_options --enable-official-branding to the .mozconfig file compiling the source code and then building the installer with mach build browser/installer/windows However, when i try to use the installer, it installs the Nightly version. How can I build a normal, standard Firefox installer for Windows, like the one distributed to standard Firefox users? Thank you, Josip ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Building Firefox install
On Monday, November 10, 2014 8:36:36 PM UTC+1, Daniel Holbert wrote: On 11/10/2014 01:44 AM, Josip Maras wrote: How can I build a normal, standard Firefox installer for Windows, like the one distributed to standard Firefox users? I don't know the answer to your specific question (I've never personally had to build the installer), but just as a heads-up: you can't legally *distribute* a modified Firefox build, using the official branding/trademarks, unless you've gotten explicit permission. See Modifications section here: https://www.mozilla.org/en-US/foundation/trademarks/policy/ Hopefully you already know this your build is just for personal use not for distribution to others. :) Anyway, good luck with your build issue. Thanks, ~Daniel Hi Daniel, Yes I know this, and it is purely for my own use - i plan to install this on a couple of computers and run some experiments. Thanks, Josip ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Problem with batch logging
Hi, Mike, Ehsan, and David, thank you! In the end, I added the Logging functionality to mozglue, exported it, and imported it wherever necessary. Now it works as expected, and there are no noticeable hangings even when working with large applications (e.g. facebook). Just in case, if a beginner like me, runs into a similar problem, this link was also useful: http://msdn.microsoft.com/en-us/library/ms235636.aspx Thank you, Josip On Wednesday, October 29, 2014 12:19:03 AM UTC+1, Mike Hommey wrote: On Wed, Oct 29, 2014 at 08:08:23AM +0900, Mike Hommey wrote: On Tue, Oct 28, 2014 at 11:56:49AM -0400, Ehsan Akhgari wrote: On 2014-10-28 4:16 AM, Josip Maras wrote: Hi Ehsan, Yes, in my opinion that is the problem. I'm trying to use the global stream variable across module boundaries, more specifically from the following source files: content\base\src\Element.cpp; layout\style\nsCSSParser.cpp; content\base\src\nsINode.cpp, js\src\builtin\Eval.cpp, js\src\vm\Interpreter.cpp, js\src\jsfun.cpp, browser\app\nsBrowserApp.cpp, content\base\src\nsDocument.cpp, dom\base\nsGlobalWindow.cpp, parser\html\nsHtml5TreeOperation.cpp, content\html\document\src\nsHTMLContentSink.cpp So it's across at least two different modules. I've tried to follow your advice in using MOZ_EXPORT and MOZ_IMPORT, but I'm not getting anywhere :-/ The application runs, but it crashes. Of the top of your head, do you maybe know of a variable that is used in a similar way, so that I can look into how this is supposed to be done. For example, if I wanted to create a stream in nsBrowserApp.cpp and then use that stream from the other files what should I do? Do I put: extern MOZ_EXPORT std::stringstream FC_LOG_STREAM; in that file (or in the header included from that file, and then i define the varible in the .cpp file) and then use MOZ_IMPORT std::stringstream FC_LOG_STREAM; in the other files/headers or? Sorry for taking up your time, but getting into the source code of Firefox, especially since I've done very little real world development in C++ is a bit overwhelming. Any help will be appreciated! These macros just expand to __declspec(dllimport/dllexport), which is documented here: http://msdn.microsoft.com/en-us/library/3y1sfaz2.aspx Hopefully you can fix your problem following those instructions. Note that due to the nature of how we load xul.dll (which is done dynamically at runtime), I think your best bet is to export the variable from firefox.exe and import it in xul.dll, otherwise firefox.exe will not load because it will try to import a symbol from xul.dll but that DLL does not exist at startup time. It's not possible to use a symbol in an executable from a dll. Not directly. The best place for something that needs to be shared between firefox.exe and xul.dll is mozglue.dll. Both are linked against it. Mike ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Problem with batch logging
Hi Ehsan, Yes, in my opinion that is the problem. I'm trying to use the global stream variable across module boundaries, more specifically from the following source files: content\base\src\Element.cpp; layout\style\nsCSSParser.cpp; content\base\src\nsINode.cpp, js\src\builtin\Eval.cpp, js\src\vm\Interpreter.cpp, js\src\jsfun.cpp, browser\app\nsBrowserApp.cpp, content\base\src\nsDocument.cpp, dom\base\nsGlobalWindow.cpp, parser\html\nsHtml5TreeOperation.cpp, content\html\document\src\nsHTMLContentSink.cpp So it's across at least two different modules. I've tried to follow your advice in using MOZ_EXPORT and MOZ_IMPORT, but I'm not getting anywhere :-/ The application runs, but it crashes. Of the top of your head, do you maybe know of a variable that is used in a similar way, so that I can look into how this is supposed to be done. For example, if I wanted to create a stream in nsBrowserApp.cpp and then use that stream from the other files what should I do? Do I put: extern MOZ_EXPORT std::stringstream FC_LOG_STREAM; in that file (or in the header included from that file, and then i define the varible in the .cpp file) and then use MOZ_IMPORT std::stringstream FC_LOG_STREAM; in the other files/headers or? Sorry for taking up your time, but getting into the source code of Firefox, especially since I've done very little real world development in C++ is a bit overwhelming. Any help will be appreciated! Thank you On Friday, October 24, 2014 7:26:00 PM UTC+2, Ehsan Akhgari wrote: It's hard to determine exactly what's happening because your post doesn't explain where you're using this variable, but note that extern variables cannot be used across module boundaries. For example, nsBrowserApp.cpp get compiled into firefox.exe, whereas most of our code gets compiled in xul.dll. If you define an extern variable somewhere in firefox.exe, you cannot use it from xul.dll. If you need this kind of cross module access, you need to export a function/variable from one module and import and call it in the other, using MOZ_EXPORT and MOZ_IMPORT_API and friends. On 2014-10-24 8:36 AM, Josip Maras wrote: Hi, I'm extending the Firefox source in order to log some information during web app execution, for example event, script executions, new element creations, removals, attribute modifications, etc. Since these things occur often, when I load a more demanding application (e.g. facebook), everything hangs for a while, because there is a large number of relatively small pieces of information being written to a file. Because of this, i was thinking of doing it in batches, having one global extern stream variable where all longs are added to, and when enough information gets accumulated to write it to a file, and avoid these hangings. Since I'm a noob C++ programmer I will paste some code of what i've done, just in case: I have one header file with the extern variable: -- FC_ExternStreamDeclaration.h -- #ifndef FC_EXTERN_VAR_DECL_H #define FC_EXTERN_VAR_DECL_H #include stdio.h #include sstream #include fstream extern std::stringstream FC_LOG_STREAM; #endif //FC_EXTERN_VAR_DECL_H and one header with the logging functionality -- FC_Log.h -- #pragma once #ifndef FC_LOG_H #define FC_LOG_H #include stdio.h #include sstream #include fstream #include FC_ExternStreamDeclaration.h inline void WriteToStream(const char** fragments, int length) { //add to stream //if stream big enough write to file } #endif //FC_LOG_H and in nsBrowserApp.cpp where the main function is defined, i define the variable and include the headers - nsBrowserApp.cpp --- #include FC_ExternStreamDeclaration.h #include FC_Log.h std::stringstream FC_LOG_STREAM; And then, in each file from which i do logging, i include the header files and call the WriteToStream function. For example, I'm doing it from Interpreter.cpp, Eval.cpp, nsINode.h, etc. (all over the code). And i thought that this will be enough. However, i get: error LNK2001 unresolved external symbol stringstream FC_LOG_STREAM. If i define it there, the compilation succeeds, but I effectively get two different streams, one for the JavaScript execution, and the other for the DOM and the rest of the browser. I'm thinking this happens because these variables are in different dlls. I would be grateful for any tips about fixing it. Sorry for the long question. Thank you, Josip ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Problem with batch logging
Thanks for the tip. Can you perhaps drop the internal stream class names, so I can investigate a bit on how to use them. Thank you! On Friday, October 24, 2014 4:56:07 PM UTC+2, David Rajchenbach-Teller wrote: Well, for one thing, never perform I/O on the main thread. It really kills performance, as you witness. No amount of batching is going to be sufficient. Also, why don't you use our stream classes? Cheers, David On 24/10/14 14:36, Josip Maras wrote: Hi, I'm extending the Firefox source in order to log some information during web app execution, for example event, script executions, new element creations, removals, attribute modifications, etc. Since these things occur often, when I load a more demanding application (e.g. facebook), everything hangs for a while, because there is a large number of relatively small pieces of information being written to a file. Because of this, i was thinking of doing it in batches, having one global extern stream variable where all longs are added to, and when enough information gets accumulated to write it to a file, and avoid these hangings. Since I'm a noob C++ programmer I will paste some code of what i've done, just in case: I have one header file with the extern variable: -- FC_ExternStreamDeclaration.h -- #ifndef FC_EXTERN_VAR_DECL_H #define FC_EXTERN_VAR_DECL_H #include stdio.h #include sstream #include fstream extern std::stringstream FC_LOG_STREAM; #endif //FC_EXTERN_VAR_DECL_H and one header with the logging functionality -- FC_Log.h -- #pragma once #ifndef FC_LOG_H #define FC_LOG_H #include stdio.h #include sstream #include fstream #include FC_ExternStreamDeclaration.h inline void WriteToStream(const char** fragments, int length) { //add to stream //if stream big enough write to file } #endif //FC_LOG_H and in nsBrowserApp.cpp where the main function is defined, i define the variable and include the headers - nsBrowserApp.cpp --- #include FC_ExternStreamDeclaration.h #include FC_Log.h std::stringstream FC_LOG_STREAM; And then, in each file from which i do logging, i include the header files and call the WriteToStream function. For example, I'm doing it from Interpreter.cpp, Eval.cpp, nsINode.h, etc. (all over the code). And i thought that this will be enough. However, i get: error LNK2001 unresolved external symbol stringstream FC_LOG_STREAM. If i define it there, the compilation succeeds, but I effectively get two different streams, one for the JavaScript execution, and the other for the DOM and the rest of the browser. I'm thinking this happens because these variables are in different dlls. I would be grateful for any tips about fixing it. Sorry for the long question. Thank you, Josip ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform -- David Rajchenbach-Teller, PhD Performance Team, Mozilla ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Problem with batch logging
Hi, I'm extending the Firefox source in order to log some information during web app execution, for example event, script executions, new element creations, removals, attribute modifications, etc. Since these things occur often, when I load a more demanding application (e.g. facebook), everything hangs for a while, because there is a large number of relatively small pieces of information being written to a file. Because of this, i was thinking of doing it in batches, having one global extern stream variable where all longs are added to, and when enough information gets accumulated to write it to a file, and avoid these hangings. Since I'm a noob C++ programmer I will paste some code of what i've done, just in case: I have one header file with the extern variable: -- FC_ExternStreamDeclaration.h -- #ifndef FC_EXTERN_VAR_DECL_H #define FC_EXTERN_VAR_DECL_H #include stdio.h #include sstream #include fstream extern std::stringstream FC_LOG_STREAM; #endif //FC_EXTERN_VAR_DECL_H and one header with the logging functionality -- FC_Log.h -- #pragma once #ifndef FC_LOG_H #define FC_LOG_H #include stdio.h #include sstream #include fstream #include FC_ExternStreamDeclaration.h inline void WriteToStream(const char** fragments, int length) { //add to stream //if stream big enough write to file } #endif //FC_LOG_H and in nsBrowserApp.cpp where the main function is defined, i define the variable and include the headers - nsBrowserApp.cpp --- #include FC_ExternStreamDeclaration.h #include FC_Log.h std::stringstream FC_LOG_STREAM; And then, in each file from which i do logging, i include the header files and call the WriteToStream function. For example, I'm doing it from Interpreter.cpp, Eval.cpp, nsINode.h, etc. (all over the code). And i thought that this will be enough. However, i get: error LNK2001 unresolved external symbol stringstream FC_LOG_STREAM. If i define it there, the compilation succeeds, but I effectively get two different streams, one for the JavaScript execution, and the other for the DOM and the rest of the browser. I'm thinking this happens because these variables are in different dlls. I would be grateful for any tips about fixing it. Sorry for the long question. Thank you, Josip ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Logging start page loading
Great, Thank you! ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Logging start page loading
Hi, Thank you! Yes, I do care about iFrames, and I'll check out nsDocShell::LoadURI. As for the logging, currently i'm using my own, simple infrastructure, but I was just curious if there is something already used by the Firefox source, e.g. I see a bunch of LOG(...) statements scattered around, so I might start with there. Thank you. On Wednesday, October 1, 2014 5:25:18 PM UTC+2, Josh Matthews wrote: On 2014-10-01 9:47 AM, Josip Maras wrote: Hi, How can I log to a file the URL of every page that has started loading? What is the best code location to do this. (I understand that this can be easily done with a Firefox plugin, but I would like to work directly in the Firefox source code). I was thinking of going with the nsURILoader class, but is there a better option? Also, what is a good built-in option for logging to a custom file, especially if this logging will be done fairly frequently. Thank you, Josip When you say page, what do you mean, exactly? Do you care about iframes? You might be interested in nsDocShell::LoadURI. With respect to logging, I don't know what you mean by built-in option; if this is just for yourself, I would recommend using fopen and fprintf, otherwise you can use the nsIFile interface. Look for uses of InitWithPath for decent examples. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Logging start page loading
Hi, How can I log to a file the URL of every page that has started loading? What is the best code location to do this. (I understand that this can be easily done with a Firefox plugin, but I would like to work directly in the Firefox source code). I was thinking of going with the nsURILoader class, but is there a better option? Also, what is a good built-in option for logging to a custom file, especially if this logging will be done fairly frequently. Thank you, Josip ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform