2009-07-24 19:11:01 +00:00
|
|
|
// Copyright (c) 2008 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef _BROWSER_RESOURCE_LOADER_BRIDGE_H
|
|
|
|
#define _BROWSER_RESOURCE_LOADER_BRIDGE_H
|
|
|
|
|
|
|
|
#include <string>
|
2010-06-21 18:02:39 +00:00
|
|
|
#include "base/message_loop_proxy.h"
|
|
|
|
#include "base/file_path.h"
|
|
|
|
#include "net/http/http_cache.h"
|
2009-07-24 19:11:01 +00:00
|
|
|
|
|
|
|
class GURL;
|
|
|
|
|
|
|
|
class BrowserResourceLoaderBridge {
|
|
|
|
public:
|
2010-06-21 18:02:39 +00:00
|
|
|
// Call this function to initialize the simple resource loader bridge.
|
|
|
|
// It is safe to call this function multiple times.
|
2009-07-24 19:11:01 +00:00
|
|
|
//
|
|
|
|
// NOTE: If this function is not called, then a default request context will
|
|
|
|
// be initialized lazily.
|
|
|
|
//
|
2010-06-21 18:02:39 +00:00
|
|
|
static void Init(const FilePath& cache_path,
|
|
|
|
net::HttpCache::Mode cache_mode,
|
|
|
|
bool no_proxy);
|
2009-07-24 19:11:01 +00:00
|
|
|
|
|
|
|
// Call this function to shutdown the simple resource loader bridge.
|
|
|
|
static void Shutdown();
|
|
|
|
|
|
|
|
// May only be called after Init.
|
|
|
|
static void SetCookie(const GURL& url,
|
|
|
|
const GURL& first_party_for_cookies,
|
|
|
|
const std::string& cookie);
|
|
|
|
static std::string GetCookies(const GURL& url,
|
|
|
|
const GURL& first_party_for_cookies);
|
2009-09-17 16:56:32 +00:00
|
|
|
static bool EnsureIOThread();
|
|
|
|
static void SetAcceptAllCookies(bool accept_all_cookies);
|
2010-06-21 18:02:39 +00:00
|
|
|
|
|
|
|
// This method should only be called after Init(), and before Shutdown().
|
|
|
|
static scoped_refptr<base::MessageLoopProxy> GetCacheThread();
|
2009-07-24 19:11:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _BROWSER_RESOURCE_LOADER_BRIDGE_H
|
|
|
|
|