chromium/content/public/test/resource_load_observer.cc

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

#include "content/public/test/resource_load_observer.h"

#include <string>
#include <vector>

#include "base/path_service.h"
#include "base/run_loop.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/content_paths.h"
#include "content/shell/browser/shell.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace content {

ResourceLoadObserver::ResourceLoadEntry::ResourceLoadEntry(
    blink::mojom::ResourceLoadInfoPtr resource_load_info,
    bool resource_is_associated_with_main_frame)
    :{}

ResourceLoadObserver::ResourceLoadEntry::~ResourceLoadEntry() = default;

ResourceLoadObserver::ResourceLoadEntry::ResourceLoadEntry(
    ResourceLoadObserver::ResourceLoadEntry&&) = default;

ResourceLoadObserver::ResourceLoadEntry&
ResourceLoadObserver::ResourceLoadEntry::operator=(
    ResourceLoadObserver::ResourceLoadEntry&&) = default;

ResourceLoadObserver::ResourceLoadObserver(Shell* shell)
    :{}

ResourceLoadObserver::ResourceLoadObserver(WebContents* web_contents)
    :{}

ResourceLoadObserver::~ResourceLoadObserver() = default;

// Use this method with the SCOPED_TRACE macro, so it shows the caller context
// if it fails.
void ResourceLoadObserver::CheckResourceLoaded(
    const GURL& original_url,
    const GURL& referrer,
    const std::string& load_method,
    network::mojom::RequestDestination request_destination,
    const base::FilePath::StringPieceType& served_file_name,
    const std::string& mime_type,
    const std::string& ip_address,
    bool was_cached,
    bool first_network_request,
    const base::TimeTicks& before_request,
    const base::TimeTicks& after_request) {}

// Returns the resource with the given url if found, otherwise nullptr.
blink::mojom::ResourceLoadInfoPtr* ResourceLoadObserver::GetResource(
    const GURL& original_url) {}

void ResourceLoadObserver::Reset() {}

void ResourceLoadObserver::WaitForResourceCompletion(const GURL& original_url) {}

// WebContentsObserver implementation:
void ResourceLoadObserver::ResourceLoadComplete(
    content::RenderFrameHost* render_frame_host,
    const GlobalRequestID& request_id,
    const blink::mojom::ResourceLoadInfo& resource_load_info) {}

void ResourceLoadObserver::DidLoadResourceFromMemoryCache(
    content::RenderFrameHost* render_frame_host,
    const GURL& url,
    const std::string& mime_type,
    network::mojom::RequestDestination request_destination) {}

}  // namespace content