Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: content/browser/browser_context.h

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: works now Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_context.h
diff --git a/content/browser/browser_context.h b/content/browser/browser_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c82481c2c07e87b39e0e4e93e4fb721d9a653b9
--- /dev/null
+++ b/content/browser/browser_context.h
@@ -0,0 +1,118 @@
+// Copyright (c) 2011 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.
+
+// This class gathers state related to an instantiation of content.
jam 2011/07/21 16:41:54 nit: "instantiation of content" is a little crypti
+
+#ifndef CONTENT_BROWSER_BROWSER_CONTEXT_H_
+#define CONTENT_BROWSER_BROWSER_CONTEXT_H_
+#pragma once
+
+#include "base/hash_tables.h"
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+namespace quota {
+class QuotaManager;
+}
+
+namespace webkit_database {
+class DatabaseTracker;
+}
+
+class ChromeBlobStorageContext;
+class DownloadManager;
+class FilePath;
+class GeolocationContentSettingsMap;
+class GeolocationPermissionContext;
+class HostZoomMap;
+class SSLHostState;
+class WebKitContext;
+
+namespace content {
+
+class ResourceContext;
+
+class BrowserContext {
+ public:
+ // Returns the path of the directory where this context's data is stored.
+ virtual FilePath GetPath() = 0;
+
+ // Return whether this context is incognito. Default is false.
+ // This doesn't belong here; http://crbug.com/89628
+ virtual bool IsOffTheRecord() = 0;
+
+ // Returns a pointer to the DatabaseTracker instance for this profile.
jam 2011/07/21 16:41:54 nit: should get rid of "profile" in this file
+ virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0;
+
+ // Retrieves a pointer to the SSLHostState associated with this profile.
+ // The SSLHostState is lazily created the first time that this method is
+ // called.
+ virtual SSLHostState* GetSSLHostState() = 0;
+
+ // Returns the DownloadManager associated with this profile.
+ virtual DownloadManager* GetDownloadManager() = 0;
+ virtual bool HasCreatedDownloadManager() const = 0;
+
+ virtual quota::QuotaManager* GetQuotaManager() = 0;
+
+ // Returns the request context information associated with this profile. Call
+ // this only on the UI thread, since it can send notifications that should
+ // happen on the UI thread.
+ virtual net::URLRequestContextGetter* GetRequestContext() = 0;
+
+ // Returns the request context appropriate for the given renderer. If the
+ // renderer process doesn't have an associated installed app, or if the
+ // installed app's is_storage_isolated() returns false, this is equivalent to
+ // calling GetRequestContext().
+ // TODO(creis): After isolated app storage is no longer an experimental
+ // feature, consider making this the default contract for GetRequestContext.
+ virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
+ int renderer_child_id) = 0;
+
+ // Returns the request context for media resources asociated with this
+ // profile.
+ virtual net::URLRequestContextGetter* GetRequestContextForMedia() = 0;
+
+ // Returns the resource context.
+ virtual const ResourceContext& GetResourceContext() = 0;
+
+ // Returns the Hostname <-> Zoom Level map for this profile.
+ virtual HostZoomMap* GetHostZoomMap() = 0;
+
+ // Returns the geolocation settings map for this profile.
+ virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() = 0;
+
+ // Returns the geolocation permission context for this profile.
+ virtual GeolocationPermissionContext* GetGeolocationPermissionContext() = 0;
+
+ // Returns true if the last time this profile was open it was exited cleanly.
+ // This doesn't belong here; http://crbug.com/76788
+ virtual bool DidLastSessionExitCleanly() = 0;
+
+ // Returns the WebKitContext assigned to this profile.
+ virtual WebKitContext* GetWebKitContext() = 0;
+
+ // Returns a pointer to the ChromeBlobStorageContext instance for this
+ // profile.
+ virtual ChromeBlobStorageContext* GetBlobStorageContext() = 0;
+};
+
+} // namespace content
+
+#if defined(COMPILER_GCC)
+namespace __gnu_cxx {
+
+template<>
+struct hash<content::BrowserContext*> {
+ std::size_t operator()(content::BrowserContext* const& p) const {
+ return reinterpret_cast<std::size_t>(p);
+ }
+};
+
+} // namespace __gnu_cxx
+#endif
+
+#endif // CONTENT_BROWSER_BROWSER_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698