CINXE.COM

Attachment 155020 Details for Bug 218636 – bookmarks-save-backup-0.patch

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta property="og:type" content="website"> <meta property="og:title" content=" Attachment 155020 Details for Bug 218636 &ndash; bookmarks-save-backup-0.patch"> <meta name="viewport" content="width=1024"> <meta name="color-scheme" content="dark light"> <meta name="generator" content="Bugzilla 20241119.1"> <meta name="bugzilla-global" content="dummy" id="bugzilla-global" data-bugzilla="{&quot;api_token&quot;:&quot;&quot;,&quot;config&quot;:{&quot;basepath&quot;:&quot;\/&quot;},&quot;constant&quot;:{&quot;COMMENT_COLS&quot;:80},&quot;param&quot;:{&quot;maxattachmentsize&quot;:&quot;10240&quot;,&quot;maxusermatches&quot;:&quot;50&quot;,&quot;splinter_base&quot;:&quot;\/page.cgi?id=splinter.html&amp;ignore=\/&quot;,&quot;use_markdown&quot;:&quot;1&quot;},&quot;string&quot;:{&quot;TextEditor&quot;:{&quot;command_bold&quot;:&quot;Bold&quot;,&quot;command_bulleted_list&quot;:&quot;Bulleted list&quot;,&quot;command_code&quot;:&quot;Code&quot;,&quot;command_heading&quot;:&quot;Heading&quot;,&quot;command_italic&quot;:&quot;Italic&quot;,&quot;command_link&quot;:&quot;Link&quot;,&quot;command_numbered_list&quot;:&quot;Numbered list&quot;,&quot;command_quote&quot;:&quot;Quote&quot;,&quot;comment_editor&quot;:&quot;Comment Editor&quot;,&quot;edit&quot;:&quot;Edit&quot;,&quot;etiquette_link&quot;:{&quot;href&quot;:&quot;page.cgi?id=etiquette.html&quot;,&quot;text&quot;:&quot;Etiquette&quot;},&quot;guidelines_link&quot;:{&quot;href&quot;:&quot;page.cgi?id=bug-writing.html&quot;,&quot;text&quot;:&quot;Bug Writing Guidelines&quot;},&quot;loading&quot;:&quot;Loading…&quot;,&quot;markdown_link&quot;:{&quot;href&quot;:&quot;https:\/\/guides.github.com\/features\/mastering-markdown\/&quot;,&quot;text&quot;:&quot;Markdown supported&quot;},&quot;preview&quot;:&quot;Preview&quot;,&quot;preview_error&quot;:&quot;Preview could not be loaded. Please try again later.&quot;,&quot;text_editor&quot;:&quot;Text Editor&quot;,&quot;toolbar_label&quot;:&quot;Markdown text-formatting toolbar&quot;},&quot;bug&quot;:&quot;bug&quot;,&quot;bug_type_required&quot;:&quot;You must select a Type for this bug&quot;,&quot;component_required&quot;:&quot;You must select a Component for this bug&quot;,&quot;description_required&quot;:&quot;You must enter a Description for this bug&quot;,&quot;short_desc_required&quot;:&quot;You must enter a Summary for this bug&quot;,&quot;version_required&quot;:&quot;You must select a Version for this bug&quot;},&quot;user&quot;:{&quot;is_new&quot;:true,&quot;login&quot;:&quot;&quot;}}"> <meta name="google-site-verification" content="JYXIuR9cAlV7fLmglSrc_4UaJS6Wzh5Mdxiorqu5AQc" /> <title> Attachment 155020 Details for Bug 218636 &ndash; bookmarks-save-backup-0.patch</title> <link href="/static/v20241119.1/skins/standard/global.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/skins/standard/attachment.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/js/jquery/ui/jquery-ui-min.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/js/jquery/ui/jquery-ui-structure-min.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/js/jquery/ui/jquery-ui-theme-min.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/skins/lib/prism.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/extensions/Needinfo/web/styles/needinfo.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/extensions/Review/web/styles/badge.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/extensions/Review/web/styles/review.css" rel="stylesheet" type="text/css"><link href="/static/v20241119.1/skins/standard/text-editor.css" rel="stylesheet" type="text/css"> <script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/jquery/jquery-min.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/jquery/ui/jquery-ui-min.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/jquery/plugins/devbridgeAutocomplete/devbridgeAutocomplete-min.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/global.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/util.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/widgets.js"></script> <script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P">BUGZILLA.value_descs = JSON.parse('{\"bug_status\":{},\"resolution\":{\"\":\"---\"}}'); review_suggestions = { _mentors: [ ], 'Bookmarks & History': [ ], _end: 1 }; static_component = 'Bookmarks & History'; </script> <script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/text-editor.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/attachment.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/field.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/lib/prism.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/extensions/GoogleAnalytics/web/js/analytics.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/js/lib/md5.min.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/extensions/Review/web/js/badge.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/extensions/Review/web/js/review.js"></script> <link href="/static/v20241119.1/skins/lib/fontawesome.min.css" rel="stylesheet" type="text/css"> <link href="/static/v20241119.1/skins/lib/fontawesome-brands.min.css" rel="stylesheet" type="text/css"> <link href="/static/v20241119.1/skins/lib/fontawesome-solid.min.css" rel="stylesheet" type="text/css"> <link rel="search" type="application/opensearchdescription+xml" title="Bugzilla@Mozilla" href="/search_plugin.cgi"><link rel="shortcut icon" href="/extensions/BMO/web/images/favicon.ico"><meta name="google-analytics" content="UA-36116321-3" data-location="https://bugzilla.mozilla.org/attachment/edit" data-title="Attachment 155020 Details for Bug 218636 &amp;ndash; bookmarks-save-backup-0.patch"> <script async src="https://www.google-analytics.com/analytics.js"></script><meta name="robots" content="noarchive"> </head> <body class="bugzilla-mozilla-org skin-standard no_javascript"> <div id="wrapper"> <header id="header" role="banner" aria-label="Global Header"> <div class="inner" role="none"> <button type="button" class="iconic ghost" id="open-menu-drawer" aria-label="Open Site Menu"> <span class="icon" aria-hidden="true" data-icon="menu"></span> </button><div id="header-external-links" class="dropdown" role="none"> <button type="button" id="header-external-menu-button" class="dropdown-button minor" aria-label="Show Mozilla Menu" aria-expanded="false" aria-haspopup="true" aria-controls="header-external-menu"> <img src="/static/v20241119.1/extensions/BMO/web/images/moz-fav-one-color-white-rgb.svg" width="32" height="32" alt=""> </button> <ul class="dropdown-content right" id="header-external-menu" role="menu" aria-label="Mozilla Menu" style="display:none;"> <li role="none"> <a href="https://www.mozilla.org/" role="menuitem"> <span class="label" role="none">Mozilla Home</span> </a> </li> <li role="separator"></li> <li role="none"> <a href="https://www.mozilla.org/privacy/websites/" role="menuitem"> <span class="label" role="none">Privacy</span> </a> </li> <li role="none"> <a href="https://www.mozilla.org/privacy/websites/#cookies" role="menuitem"> <span class="label" role="none">Cookies</span> </a> </li> <li role="none"> <a href="https://www.mozilla.org/about/legal/" role="menuitem"> <span class="label" role="none">Legal</span> </a> </li> </ul> </div> <h1 id="header-title" class="title" role="none"> <a class="header-button" href="https://bugzilla.mozilla.org/home" title="Go to home page"> <span aria-label="Go to Bugzilla Home Page">Bugzilla</span> </a> </h1> <form id="header-search" class="quicksearch" action="/buglist.cgi" data-no-csrf role="search" aria-label="Search Bugs"> <button type="button" class="iconic ghost" id="show-searchbox" aria-label="Search Bugs"> <span class="icon" aria-hidden="true" data-icon="search"></span> </button> <div class="searchbox-outer dropdown" role="combobox" aria-label="Quick Search" aria-haspopup="listbox" aria-owns="header-search-dropdown" aria-expanded="false"> <span class="icon" aria-hidden="true" data-icon="search"></span> <input id="quicksearch_top" class="dropdown-button" name="quicksearch" autocomplete="off" value="" accesskey="s" placeholder="Search Bugs" title="Enter a bug number or some search terms" role="searchbox" aria-controls="header-search-dropdown" aria-label="Search Terms"><div id="header-search-dropdown" class="dropdown-content dropdown-panel right" role="listbox" style="display: none;"> <div id="header-search-dropdown-wrapper" role="none"> <section id="header-search-dropdown-help" role="group" aria-label="Help"> <footer role="none"> <a href="/page.cgi?id=quicksearch.html">Quick Search Tips</a> <a href="/query.cgi?format=advanced">Advanced Search</a> </footer> </section> </div> </div> </div> </form> <nav id="header-nav" role="menubar" aria-label="Site Links"> <ul class="links" role="none"><li role="none"> <a class="header-button" href="/describecomponents.cgi" title="Browse bugs by component" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="category"></span> <span class="label" role="none">Browse</span> </a> </li> <li role="none"> <a class="header-button" href="/query.cgi?format=advanced" title="Search bugs using various criteria" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="pageview"></span> <span class="label" role="none">Advanced Search</span> </a> </li> <li role="none"> <a class="header-button" href="/enter_bug.cgi" title="File a new bug" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="add_box"></span> <span class="label" role="none">New Bug</span> </a> </li> </ul> <div class="dropdown" role="none"> <button type="button" id="header-tools-menu-button" class="header-button dropdown-button minor" title="More tools…" role="menuitem" aria-label="Show More Tools Menu" aria-expanded="false" aria-haspopup="true" aria-controls="header-tools-menu"> <span class="icon" aria-hidden="true" data-icon="more_horiz"></span> </button> <ul class="dropdown-content left" id="header-tools-menu" role="menu" aria-label="More Tools Menu" style="display:none;"><li role="none"> <a href="/report.cgi" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="analytics"></span> <span class="label" role="none">Reports</span> </a> </li> <li role="separator"></li> <li role="none"> <a href="https://bmo.readthedocs.io/en/latest/" target="_blank" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="help"></span> <span class="label" role="none">Documentation</span> </a> </li> </ul> </div> </nav> <ul id="header-login" class="links" role="none"><li id="mini_login_container_top" role="none"> <a id="login_link_top" href="/index.cgi?GoAheadAndLogIn=1" class='show_mini_login_form header-button' data-qs-suffix="_top" role="button"> <span class="icon" aria-hidden="true" data-icon="login"></span> <span class="label" role="none">Log In</span> </a> <div id="mini_login_top" class="mini-popup mini_login bz_default_hidden"> <form method="post" action="/github.cgi"> <input type="hidden" name="github_token" value="Ba53DiViKWCF8EYtHYEwxJqEbSJBHx6HtmnOEAPlYcjmySd1kIdVqTqhjQ3FfJvwC0Sd3oRMbH09NZRwGvM8Ql6iQnXTXG4Nz8h3t09fGzpCYTqGsEZ7stuPyJcACCC4mLSs8TA5ajTFpaLgS6CLZuDRYlEhDqZeEWTMXSeHWUuaGt6Uopl0IakyCtDe1oAFgZhxYZ4D22uBwahvL2zZ7wFiG6teVXcphUKfGWXELw3DuoVxsArIfG8Ex9mOq7Fj"> <input type="hidden" name="target_uri" value="https://bugzilla.mozilla.org/attachment.cgi"> <button type="submit"> <i class="fab fa-github"></i> Log In with GitHub </button> </form> <div class="method-separator">or</div> <form action="/attachment.cgi?id=155020&amp;action=edit" method="POST" data-qs-suffix="_top"> <input id="Bugzilla_login_top" class="bz_login" name="Bugzilla_login" title="Login" placeholder="Email" aria-label="Email" type="email" required > <input class="bz_password" id="Bugzilla_password_top" name="Bugzilla_password" type="password" title="Password" placeholder="Password" aria-label="Password" required > <input class="bz_password bz_default_hidden bz_mini_login_help" type="text" id="Bugzilla_password_dummy_top" value="password" title="Password" > <span class="remember-outer"> <input type="checkbox" id="Bugzilla_remember_top" name="Bugzilla_remember" value="on" class="bz_remember" checked> <label for="Bugzilla_remember_top">Remember me</label> </span> <input type="hidden" name="Bugzilla_login_token" value="1732390093-7DOl2vHyQDl4ZcO87_MdZdH8C5h5kfwWlm8pun-9ICg"> <input type="submit" name="GoAheadAndLogIn" value="Log In" id="log_in_top" class="check_mini_login_fields" data-qs-suffix="_top"> <a href="#" id="hide_mini_login_top" aria-label="Close" class="close-button hide_mini_login_form" data-qs-suffix="_top"> <span class="icon" aria-hidden="true"></span> </a> </form> <div class="footer"> <a href="/createaccount.cgi">Create an Account</a> &middot; <a id="forgot_link_top" href="/index.cgi?GoAheadAndLogIn=1#forgot" class='show_forgot_form' data-qs-suffix="_top">Forgot Password</a> </div> </div> <div id="forgot_form_top" class="mini-popup mini_forgot bz_default_hidden"> <form action="/token.cgi" method="post"> <input type="email" name="loginname" size="20" placeholder="Email" aria-label="Email" required> <input id="forgot_button_top" value="Reset Password" type="submit"> <input type="hidden" name="a" value="reqpw"> <input type="hidden" id="token_top" name="token" value="1732390093-0ZkPEr9_A_F2cxS0wbU0KPLi6ISbIp_jSzBIQ7GZ_Zw"> <a href="#" class="close-button hide_forgot_form" aria-label="Close" data-qs-suffix="_top"> <span class="icon" aria-hidden="true"></span> </a> </form> </div> </li> </ul> </div> <dialog id="menu-drawer" inert aria-label="Site Menu"> <div class="drawer-inner" role="none"> <div class="header" role="none"> <button type="button" class="iconic ghost" id="close-menu-drawer" aria-label="Close Site Menu"> <span class="icon" aria-hidden="true" data-icon="close"></span> </button> </div> <ul role="menu" aria-label="Site Links"><li role="none"> <a class="header-button" href="/describecomponents.cgi" title="Browse bugs by component" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="category"></span> <span class="label" role="none">Browse</span> </a> </li> <li role="none"> <a class="header-button" href="/query.cgi?format=advanced" title="Search bugs using various criteria" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="pageview"></span> <span class="label" role="none">Advanced Search</span> </a> </li> <li role="none"> <a class="header-button" href="/enter_bug.cgi" title="File a new bug" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="add_box"></span> <span class="label" role="none">New Bug</span> </a> </li><li role="none"> <a href="/report.cgi" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="analytics"></span> <span class="label" role="none">Reports</span> </a> </li> <li role="separator"></li> <li role="none"> <a href="https://bmo.readthedocs.io/en/latest/" target="_blank" role="menuitem"> <span class="icon" aria-hidden="true" data-icon="help"></span> <span class="label" role="none">Documentation</span> </a> </li> </ul> </div> </dialog> </header> <main id="bugzilla-body" tabindex="-1"> <aside id="message-container" role="complementary"> <noscript> <div class="noscript"> <div class="inner"> <p>Please enable JavaScript in your browser to use all the features on this site.</p> </div> </div> </noscript> </aside> <div id="main-inner"> <h2> Attachment 155020 Details for <a class="bz_bug_link bz_status_RESOLVED bz_closed" title="RESOLVED FIXED - backup bookmark file" href="/show_bug.cgi?id=218636">Bug 218636</a></h2> <form method="post" action="/attachment.cgi" onsubmit="normalizeComments();"> <input type="hidden" name="bugid" value="218636"> <input type="hidden" name="id" value="155020"> <input type="hidden" name="action" value="update"> <input type="hidden" name="contenttypemethod" value="manual"> <input type="hidden" name="delta_ts" value="2004-08-08 05:43:54"> <div id="attachment_info" class="attachment_info read"> <div id="attachment_attributes"> <div id="attachment_information_read_only" class=""> <div class="title">[patch] <span class="" title="">bookmarks-save-backup-0.patch </span> </div> <div class="details">bookmarks-save-backup-0.patch (text/plain), 9.04 KB, created by <span class="vcard vcard_24534"><span class="fn">Vladimir Vukicevic [:vlad] [:vladv] (needinfo me, slow to respond)</span> </span> </div> </div> <div id="attachment_information_edit"> <span class="bz_hide"> (<a href="javascript:toggle_attachment_details_visibility();">hide</a>) </span> <div id="attachment_description"> <label for="description">Description:</label>&nbsp;<textarea name="description" id="description" class="block bz_hidden_option" wrap="soft" rows="3" cols="25">bookmarks-save-backup-0.patch</textarea> </div> <div id="attachment_filename"> <label for="filename">Filename:</label> <input type="text" size="20" class="text block bz_hidden_option" id="filename" name="filename" value="bookmarks-save-backup-0.patch"> </div> <div id="attachment_mimetype"> <label for="contenttypeentry">MIME Type:</label> <input type="text" size="20" class="text block bz_hidden_option" id="contenttypeentry" name="contenttypeentry" value="text/plain"> </div> <div id="attachment_creator"> <span class="label">Creator:</span> <span class="vcard vcard_24534"><span class="fn">Vladimir Vukicevic [:vlad] [:vladv] (needinfo me, slow to respond)</span> </span> </div> <div id="attachment_size"> <span class="label">Size:</span> 9.04 KB </div> <div id="attachment_ispatch"> <input type="checkbox" id="ispatch" name="ispatch" value="1" checked="checked"> <label for="ispatch">patch</label> </div> <div class="readonly"> <div class="checkboxes"> <div id="attachment_isobsolete"> <input type="checkbox" id="isobsolete" name="isobsolete" value="1" > <label for="isobsolete">obsolete</label> </div> </div> </div> </div> <div id="attachment_view_window"> <div> <input type="hidden" name="markdown_off" value="0"><textarea name="comment" id="editFrame" class="bz_default_hidden" wrap="soft" disabled="disabled" rows="10" cols="80">&gt;? nsBookmarksService.cpp.save &gt;? q &gt;Index: nsBookmarksService.cpp &gt;=================================================================== &gt;RCS file: /cvsroot/mozilla/browser/components/bookmarks/src/nsBookmarksService.cpp,v &gt;retrieving revision 1.32.4.12 &gt;diff -u -8 -p -r1.32.4.12 nsBookmarksService.cpp &gt;--- nsBookmarksService.cpp 31 Jul 2004 02:22:39 -0000 1.32.4.12 &gt;+++ nsBookmarksService.cpp 2 Aug 2004 20:46:57 -0000 &gt;&#64;&#64; -1621,17 +1621,18 &#64;&#64; BookmarkParser::AssertTime(nsIRDFResourc &gt; &gt; //////////////////////////////////////////////////////////////////////// &gt; // nsBookmarksService implementation &gt; &gt; nsBookmarksService::nsBookmarksService() : &gt; mInner(nsnull), &gt; mUpdateBatchNest(0), &gt; mBookmarksAvailable(PR_FALSE), &gt;- mDirty(PR_FALSE) &gt;+ mDirty(PR_FALSE), &gt;+ mNeedBackupUpdate(PR_FALSE) &gt; &gt; #if defined(XP_MAC) || defined(XP_MACOSX) &gt; ,mIEFavoritesAvailable(PR_FALSE) &gt; #endif &gt; { } &gt; &gt; nsBookmarksService::~nsBookmarksService() &gt; { &gt;&#64;&#64; -1713,33 +1714,29 &#64;&#64; nsBookmarksService::Init() &gt; observerService-&gt;AddObserver(this, &quot;profile-before-change&quot;, PR_TRUE); &gt; observerService-&gt;AddObserver(this, &quot;profile-after-change&quot;, PR_TRUE); &gt; observerService-&gt;AddObserver(this, &quot;quit-application&quot;, PR_TRUE); &gt; } &gt; &gt; rv = InitDataSource(); &gt; NS_ENSURE_SUCCESS(rv, rv); &gt; &gt;- // bookmark timers and scheduling are disabled for 1.0, until &gt;- // they can be fixed (bug 253478) &gt;-#if 0 &gt; /* timer initialization */ &gt; busyResource = nsnull; &gt; &gt; if (!mTimer) &gt; { &gt; busySchedule = PR_FALSE; &gt; mTimer = do_CreateInstance(&quot;&#64;mozilla.org/timer;1&quot;, &amp;rv); &gt; NS_ASSERTION(NS_SUCCEEDED(rv), &quot;unable to create a timer&quot;); &gt; if (NS_FAILED(rv)) return rv; &gt; mTimer-&gt;InitWithFuncCallback(nsBookmarksService::FireTimer, this, BOOKMARK_TIMEOUT, &gt; nsITimer::TYPE_REPEATING_SLACK); &gt; // Note: don't addref &quot;this&quot; as we'll cancel the timer in the nsBookmarkService destructor &gt; } &gt;-#endif &gt; &gt; // register this as a named data source with the RDF &gt; // service. Do this *last*, because if Init() fails, then the &gt; // object will be destroyed (leaving the RDF service with a &gt; // dangling pointer). &gt; rv = gRDF-&gt;RegisterDataSource(this, PR_FALSE); &gt; if (NS_FAILED(rv)) return rv; &gt; &gt;&#64;&#64; -1985,21 +1982,29 &#64;&#64; nsBookmarksService::GetBookmarkToPing(ns &gt; &gt; void &gt; nsBookmarksService::FireTimer(nsITimer* aTimer, void* aClosure) &gt; { &gt; nsBookmarksService *bmks = NS_STATIC_CAST(nsBookmarksService *, aClosure); &gt; if (!bmks) return; &gt; nsresult rv; &gt; &gt;+ if (bmks-&gt;mNeedBackupUpdate == PR_TRUE) &gt;+ { &gt;+ bmks-&gt;SaveToBackup(); &gt;+ } &gt;+ &gt; if ((bmks-&gt;mBookmarksAvailable == PR_TRUE) &amp;&amp; (bmks-&gt;mDirty == PR_TRUE)) &gt; { &gt; bmks-&gt;Flush(); &gt; } &gt; &gt;+ // bookmark timers and scheduling are disabled for 1.0, until &gt;+ // they can be fixed (bug 253478) &gt;+#if 0 &gt; if (bmks-&gt;busySchedule == PR_FALSE) &gt; { &gt; nsCOMPtr&lt;nsIRDFResource&gt; bookmark; &gt; if (NS_SUCCEEDED(rv = bmks-&gt;GetBookmarkToPing(getter_AddRefs(bookmark))) &amp;&amp; (bookmark)) &gt; { &gt; bmks-&gt;busyResource = bookmark; &gt; &gt; nsAutoString url; &gt;&#64;&#64; -2034,16 +2039,17 &#64;&#64; nsBookmarksService::FireTimer(nsITimer* &gt; } &gt; } &gt; #ifdef DEBUG_BOOKMARK_PING_OUTPUT &gt; else &gt; { &gt; printf(&quot;nsBookmarksService::FireTimer - busy pinging.\n&quot;); &gt; } &gt; #endif &gt;+#endif &gt; } &gt; &gt; &gt; // stream observer methods &gt; &gt; NS_IMETHODIMP &gt; nsBookmarksService::OnStartRequest(nsIRequest* request, nsISupports *ctxt) &gt; { &gt;&#64;&#64; -4248,37 +4254,108 &#64;&#64; nsBookmarksService::Flush() &gt; { &gt; nsCOMPtr&lt;nsIFile&gt; bookmarksFile; &gt; rv = GetBookmarksFile(getter_AddRefs(bookmarksFile)); &gt; &gt; // Oh well, couldn't get the bookmarks file. Guess there &gt; // aren't any bookmarks for us to write out. &gt; if (NS_FAILED(rv)) return NS_OK; &gt; &gt;+ if (mNeedBackupUpdate) &gt;+ SaveToBackup(); &gt;+ &gt; rv = WriteBookmarks(bookmarksFile, mInner, kNC_BookmarksRoot); &gt;+ if (NS_SUCCEEDED(rv)) &gt;+ mNeedBackupUpdate = PR_TRUE; &gt; } &gt; return rv; &gt; } &gt; &gt; NS_IMETHODIMP &gt; nsBookmarksService::FlushTo(const char *aURI) &gt; { &gt; // Do not ever implement this (security) &gt; return NS_ERROR_NOT_IMPLEMENTED; &gt; } &gt; &gt; &gt; //////////////////////////////////////////////////////////////////////// &gt; // Implementation methods &gt; &gt;+// save a copy of the last bookmarks file, if it exists, to bookmarks.bak &gt;+void &gt;+nsBookmarksService::SaveToBackup() &gt;+{ &gt;+ nsresult rv; &gt;+ &gt;+ nsCOMPtr&lt;nsIFile&gt; bookmarksFile; &gt;+ rv = GetBookmarksFile(getter_AddRefs(bookmarksFile)); &gt;+ &gt;+ if (NS_FAILED(rv) || !bookmarksFile) &gt;+ return; &gt;+ &gt;+ PRBool exists; &gt;+ bookmarksFile-&gt;Exists(&amp;exists); &gt;+ &gt;+ if (!exists) &gt;+ return; &gt;+ &gt;+ nsCOMPtr&lt;nsIFile&gt; backupFile, parentFolder; &gt;+ bookmarksFile-&gt;GetParent(getter_AddRefs(parentFolder)); &gt;+ if (parentFolder) { &gt;+ rv = bookmarksFile-&gt;CopyTo(parentFolder, NS_LITERAL_STRING(&quot;bookmarks.bak&quot;)); &gt;+ if (NS_SUCCEEDED(rv)) &gt;+ mNeedBackupUpdate = PR_FALSE; &gt;+ } &gt;+} &gt;+ &gt;+// Attempt to restore a truncated or non-existent bookmarks.html file &gt;+// from the backup file generated by the last successful write. &gt;+void &gt;+nsBookmarksService::MaybeRestoreFromBackup(nsIFile* aBookmarkFile, nsIFile* aParentFolder) &gt;+{ &gt;+ if (!aBookmarkFile) &gt;+ return; &gt;+ &gt;+ PRBool exists; &gt;+ aBookmarkFile-&gt;Exists(&amp;exists); &gt;+ if (exists) &gt;+ { &gt;+ PRInt64 fileSize; &gt;+ aBookmarkFile-&gt;GetFileSize(&amp;fileSize); &gt;+ if (fileSize == 0) &gt;+ { &gt;+ aBookmarkFile-&gt;Remove(PR_FALSE); &gt;+ exists = PR_FALSE; &gt;+ } &gt;+ } &gt;+ if (!exists) &gt;+ { &gt;+ nsCOMPtr&lt;nsIFile&gt; backupFile; &gt;+ aParentFolder-&gt;Clone(getter_AddRefs(backupFile)); &gt;+ if (aParentFolder &amp;&amp; backupFile) &gt;+ { &gt;+ backupFile-&gt;Append(NS_LITERAL_STRING(&quot;bookmarks.bak&quot;)); &gt;+ backupFile-&gt;Exists(&amp;exists); &gt;+ if (exists) &gt;+ { &gt;+ nsAutoString bookmarksFileName; &gt;+ aBookmarkFile-&gt;GetLeafName(bookmarksFileName); &gt;+ &gt;+ backupFile-&gt;CopyTo(aParentFolder, bookmarksFileName); &gt;+ } &gt;+ } &gt;+ } &gt;+} &gt;+ &gt; nsresult &gt; nsBookmarksService::GetBookmarksFile(nsIFile* *aResult) &gt; { &gt; nsresult rv; &gt;- nsCOMPtr&lt;nsIFile&gt; bookmarksFile; &gt;+ nsCOMPtr&lt;nsIFile&gt; bookmarksFile, parentFolder; &gt; &gt; // First we see if the user has set a pref for the location of the &gt; // bookmarks file. &gt; nsCOMPtr&lt;nsIPref&gt; prefServ(do_GetService(kPrefCID, &amp;rv)); &gt; if (NS_SUCCEEDED(rv)) &gt; { &gt; nsXPIDLCString prefVal; &gt; rv = prefServ-&gt;CopyCharPref(&quot;browser.bookmarks.file&quot;, &gt;&#64;&#64; -4287,27 +4364,36 &#64;&#64; nsBookmarksService::GetBookmarksFile(nsI &gt; { &gt; rv = NS_NewNativeLocalFile(prefVal, PR_TRUE, &gt; (nsILocalFile**)(nsIFile**) getter_AddRefs(bookmarksFile)); &gt; &gt; if (NS_SUCCEEDED(rv)) &gt; { &gt; *aResult = bookmarksFile; &gt; NS_ADDREF(*aResult); &gt;+ &gt;+ bookmarksFile-&gt;GetParent(getter_AddRefs(parentFolder)); &gt;+ if (parentFolder) &gt;+ MaybeRestoreFromBackup(*aResult, parentFolder); &gt;+ &gt; return NS_OK; &gt; } &gt; } &gt; } &gt; &gt; &gt; // Otherwise, we look for bookmarks.html in the current profile &gt; // directory using the magic directory service. &gt; rv = NS_GetSpecialDirectory(NS_APP_BOOKMARKS_50_FILE, aResult); &gt; NS_ENSURE_SUCCESS(rv, rv); &gt; &gt;+ NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(parentFolder)); &gt;+ if (parentFolder) &gt;+ MaybeRestoreFromBackup(*aResult, parentFolder); &gt;+ &gt; return NS_OK; &gt; } &gt; &gt; &gt; #if defined(XP_MAC) || defined(XP_MACOSX) &gt; &gt; nsresult &gt; nsBookmarksService::ReadFavorites() &gt;Index: nsBookmarksService.h &gt;=================================================================== &gt;RCS file: /cvsroot/mozilla/browser/components/bookmarks/src/nsBookmarksService.h,v &gt;retrieving revision 1.14.4.2 &gt;diff -u -8 -p -r1.14.4.2 nsBookmarksService.h &gt;--- nsBookmarksService.h 17 Jul 2004 05:33:33 -0000 1.14.4.2 &gt;+++ nsBookmarksService.h 2 Aug 2004 20:46:57 -0000 &gt;&#64;&#64; -87,16 +87,17 &#64;&#64; protected: &gt; &gt; PRUint32 htmlSize; &gt; PRInt32 mUpdateBatchNest; &gt; nsXPIDLString mPersonalToolbarName; &gt; PRBool mBookmarksAvailable; &gt; PRBool mDirty; &gt; PRBool mBrowserIcons; &gt; PRBool busySchedule; &gt;+ PRBool mNeedBackupUpdate; &gt; &gt; public: &gt; // bookmark resources used to indicate that a livemark &gt; // is either loading or failed to load. &gt; nsCOMPtr&lt;nsIRDFResource&gt; mLivemarkLoadingBookmark; &gt; nsCOMPtr&lt;nsIRDFResource&gt; mLivemarkLoadFailedBookmark; &gt; &gt; protected: &gt;&#64;&#64; -173,16 +174,19 &#64;&#64; protected: &gt; &gt; nsresult LoadBookmarks(); &gt; nsresult InitDataSource(); &gt; &gt; nsresult GetLastModifiedFolders(nsISimpleEnumerator **aResult); &gt; &gt; nsresult UpdateLivemarkChildren(nsIRDFResource* aSource); &gt; &gt;+ void SaveToBackup(); &gt;+ void MaybeRestoreFromBackup(nsIFile* aBookmarkFile, nsIFile* aParentFolder); &gt;+ &gt; // nsIStreamObserver methods: &gt; NS_DECL_NSIREQUESTOBSERVER &gt; &gt; // nsIStreamListener methods: &gt; NS_DECL_NSISTREAMLISTENER &gt; &gt; // nsIObserver methods: &gt; NS_DECL_NSIOBSERVER </textarea> <iframe id="viewFrame" src="/attachment.cgi?id=155020" sandbox> <b>You cannot view the attachment while viewing its details because your browser does not support IFRAMEs. <a href="/attachment.cgi?id=155020">View the attachment on a separate page</a>.</b> </iframe> <script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P"> <!-- var patchviewerinstalled = 0; var attachment_id = 155020; if (typeof document.getElementById == "function") { var patchviewerinstalled = 1; document.write('<iframe id="viewDiffFrame" class="bz_default_hidden"><\/iframe>'); document.write('<button type="button" id="viewDiffButton" onclick="viewDiff(attachment_id, patchviewerinstalled);">View Attachment As Diff<\/button>'); document.write('<button type="button" id="viewRawButton" onclick="viewRaw(patchviewerinstalled);" class="bz_default_hidden">View Attachment As Raw<\/button>'); } //--> </script> </div> </div> <div id="attachment_comments_and_flags"> <div id="attachment_flags"><p><b>Flags:</b></p> <span title="Ben Goodger (use ben at mozilla dot org for email)">bugs</span>: review+<br> <span title="Ben Goodger (use ben at mozilla dot org for email)">bugs</span>: approval-aviary+<br> </div> </div> </div> </div> </form> <div id="attachment_actions"> <span class="label">Actions:</span> <a href="/attachment.cgi?id=155020">View</a> | <a href="/attachment.cgi?id=155020&amp;action=diff">Diff</a>&#x0020; | <a href="/page.cgi?id=splinter.html&ignore=&bug=218636&attachment=155020">Review</a> </div> <div id="attachment_list"> Attachments on <a class="bz_bug_link bz_status_RESOLVED bz_closed" title="RESOLVED FIXED - backup bookmark file" href="/show_bug.cgi?id=218636">bug 218636</a>: <span class="bz_obsolete"> <a href="/attachment.cgi?id=154340&amp;action=edit" title="simple patch">154340</a> </span> | 155020 </div><link rel="stylesheet" href="/static/v20241119.1/extensions/FlagTypeComment/web/styles/ftc.css"> <script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P" src="/static/v20241119.1/extensions/FlagTypeComment/web/js/ftc.js"></script><script nonce="0Xl6JJMfmehFH5F9JXHc6MhW2tcv54YF7xQCEAo2ve6YOZ4P"> $(function() { REVIEW.init_mandatory(); }); </script> </div> </main> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10