<commit_before>(function() {

  // Private fields

  var AUTH_URL = "https://www.dropbox.com/1/oauth2/authorize" +
      "?response_type=token&client_id=u4emlzpeiilp7n0" +
      "&redirect_uri=" + chrome.identity.getRedirectURL("");

  var CHUNK_SIZE = 1024 * 1024 * 4; // 4MB

  // Constructor

  var DropboxClient = function(dropboxFS) {
    this.dropbox_fs_ = dropboxFS;
    this.access_token_ = null;
    this.writeRequestMap = {};
    initializeJQueryAjaxBinaryHandler.call(this);
  };

  // Public functions

  DropboxClient.prototype.authorize = function(successCallback, errorCallback) {
    this.access_token_ = null;
    chrome.identity.launchWebAuthFlow({
      "url": AUTH_URL,
      "interactive": true
    }, function(redirectUrl) {
      console.log(redirectUrl);
      if (redirectUrl) {
        var parametersStr = redirectUrl.substring(redirectUrl.indexOf("#") + 1);
        var parameters = parametersStr.split("&");
        for (var i = 0; i < parameters.length; i++) {
          var parameter = parameters[i];
          var kv = parameter.split("=");
          if (kv[0] === "access_token") {
            this.access_token_ = kv[1];
          }
        }
        if (this.access_token_) {
          successCallback();
        } else {
          errorCallback("Issuing Access token failed");
        }<commit_msg>Added chrome.runtime.error check during web auth flow.<commit_after>(function() {

  // Private fields

  var AUTH_URL = "https://www.dropbox.com/1/oauth2/authorize" +
      "?response_type=token&client_id=u4emlzpeiilp7n0" +
      "&redirect_uri=" + chrome.identity.getRedirectURL("");

  var CHUNK_SIZE = 1024 * 1024 * 4; // 4MB

  // Constructor

  var DropboxClient = function(dropboxFS) {
    this.dropbox_fs_ = dropboxFS;
    this.access_token_ = null;
    this.writeRequestMap = {};
    initializeJQueryAjaxBinaryHandler.call(this);
  };

  // Public functions

  DropboxClient.prototype.authorize = function(successCallback, errorCallback) {
    this.access_token_ = null;
    chrome.identity.launchWebAuthFlow({
      "url": AUTH_URL,
      "interactive": true
    }, function(redirectUrl) {
      if (chrome.runtime.lastError) {
        errorCallback(chrome.runtime.lastError.message);
        return;
      }
      if (redirectUrl) {
        var parametersStr = redirectUrl.substring(redirectUrl.indexOf("#") + 1);
        var parameters = parametersStr.split("&");
        for (var i = 0; i < parameters.length; i++) {
          var parameter = parameters[i];
          var kv = parameter.split("=");
          if (kv[0] === "access_token") {
            this.access_token_ = kv[1];
          }
        }
        if (this.access_token_) {
          successCallback();
        } else {
          errorCallback("Issuing Access token failed");
        }
{'fraction_non_alphanumeric': 0.1317108088761632, 'fraction_numerical': 0.013600572655690766, 'mean_word_length': 2.634590377113134, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6565977', 'n_tokens_mistral': 886, 'n_tokens_neox': 839, 'n_words': 157}