Skip to content

Commit

Permalink
Merge pull request #5340 from electron/create-user-data
Browse files Browse the repository at this point in the history
Make sure the userData directory is created before ready event
  • Loading branch information
zcbenz committed Apr 29, 2016
2 parents f7d4ff9 + 6685334 commit cb45c94
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions atom/browser/browser.cc
Expand Up @@ -9,7 +9,10 @@
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#include "base/files/file_util.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "brightray/browser/brightray_paths.h"

namespace atom {

Expand Down Expand Up @@ -139,6 +142,11 @@ void Browser::WillFinishLaunching() {
}

void Browser::DidFinishLaunching() {
// Make sure the userData directory is created.
base::FilePath user_data;
if (PathService::Get(brightray::DIR_USER_DATA, &user_data))
base::CreateDirectoryAndGetError(user_data, nullptr);

is_ready_ = true;
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching());
}
Expand Down

0 comments on commit cb45c94

Please sign in to comment.