chromium/extensions/browser/updater/manifest_fetch_data.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/browser/updater/manifest_fetch_data.h"

#include <iterator>
#include <vector>

#include "base/check.h"
#include "base/containers/contains.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "extensions/browser/disable_reason.h"
#include "extensions/common/extension_id.h"

ManifestLocation;

namespace extensions {

namespace {

// Maximum length of an extension manifest update check url, since it is a GET
// request. We want to stay under 2K because of proxies, etc.
const int kExtensionsManifestMaxURLSize =;

// Strings to report the manifest location in Omaha update pings. Please use
// strings with no capitalization, spaces or underscorse.
const char kInternalLocation[] =;
const char kExternalLocation[] =;
const char kPolicyLocation[] =;
const char kOtherLocation[] =;
const char kInvalidLocation[] =;

void AddEnabledStateToPing(std::string* ping_value,
                           const DownloadPingData* ping_data) {}

}  // namespace

ManifestFetchData::ExtensionData::ExtensionData() :{}

ManifestFetchData::ExtensionData::ExtensionData(const ExtensionData& other) =
    default;

ManifestFetchData::ExtensionData::ExtensionData(
    const base::Version& version,
    const std::string& update_url_data,
    const std::string& install_source,
    ManifestLocation extension_location)
    :{}

ManifestFetchData::ExtensionData::~ExtensionData() = default;

// static
std::string ManifestFetchData::GetSimpleLocationString(ManifestLocation loc) {}

ManifestFetchData::ManifestFetchData(const GURL& update_url,
                                     int request_id,
                                     const std::string& brand_code,
                                     const std::string& base_query_params,
                                     PingMode ping_mode,
                                     DownloadFetchPriority fetch_priority)
    :{}

ManifestFetchData::~ManifestFetchData() = default;

// The format for request parameters in update checks is:
//
//   ?x=EXT1_INFO&x=EXT2_INFO
//
// where EXT1_INFO and EXT2_INFO are url-encoded strings of the form:
//
//   id=EXTENSION_ID&v=VERSION&uc
//
// Provide ping data with the parameter ping=PING_DATA where PING_DATA
// looks like r=DAYS or a=DAYS for extensions in the Chrome extensions gallery.
// ('r' refers to 'roll call' ie installation, and 'a' refers to 'active').
// These values will each be present at most once every 24 hours, and indicate
// the number of days since the last time it was present in an update check.
//
// So for two extensions like:
//   Extension 1- id:aaaa version:1.1
//   Extension 2- id:bbbb version:2.0
//
// the full update url would be:
//   http://somehost/path?x=id%3Daaaa%26v%3D1.1%26uc&x=id%3Dbbbb%26v%3D2.0%26uc
//
// (Note that '=' is %3D and '&' is %26 when urlencoded.)
bool ManifestFetchData::AddExtension(const std::string& id,
                                     const std::string& version,
                                     const DownloadPingData* ping_data,
                                     const std::string& update_url_data,
                                     const std::string& install_source,
                                     ManifestLocation extension_location,
                                     DownloadFetchPriority fetch_priority) {}

void ManifestFetchData::AddAssociatedTask(ExtensionDownloaderTask task) {}

void ManifestFetchData::UpdateFullUrl(const std::string& base_query_params) {}

void ManifestFetchData::RemoveExtensions(const ExtensionIdSet& id_to_remove,
                                         const std::string& base_query_params) {}

ExtensionIdSet ManifestFetchData::GetExtensionIds() const {}

bool ManifestFetchData::Includes(const ExtensionId& extension_id) const {}

bool ManifestFetchData::DidPing(const ExtensionId& extension_id,
                                PingType type) const {}

void ManifestFetchData::Merge(std::unique_ptr<ManifestFetchData> other) {}

void ManifestFetchData::set_is_all_external_policy_download() {}

std::vector<ExtensionDownloaderTask> ManifestFetchData::TakeAssociatedTasks() {}
}  // namespace extensions