| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/debug/stack_trace.h" | |
| 12 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 16 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 17 #include "chrome/browser/net/chrome_url_request_context.h" | 16 #include "chrome/browser/net/chrome_url_request_context.h" |
| 18 #include "chrome/browser/prefs/pref_member.h" | 17 #include "chrome/browser/prefs/pref_member.h" |
| 19 #include "content/browser/resource_context.h" | 18 #include "content/browser/resource_context.h" |
| 20 #include "net/base/cookie_monster.h" | 19 #include "net/base/cookie_monster.h" |
| 21 | 20 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 class ProfileIOData : public base::RefCountedThreadSafe<ProfileIOData> { | 72 class ProfileIOData : public base::RefCountedThreadSafe<ProfileIOData> { |
| 74 public: | 73 public: |
| 75 // Returns true if |scheme| is handled in Chrome, or by default handlers in | 74 // Returns true if |scheme| is handled in Chrome, or by default handlers in |
| 76 // net::URLRequest. | 75 // net::URLRequest. |
| 77 static bool IsHandledProtocol(const std::string& scheme); | 76 static bool IsHandledProtocol(const std::string& scheme); |
| 78 | 77 |
| 79 // Returns true if |url| is handled in Chrome, or by default handlers in | 78 // Returns true if |url| is handled in Chrome, or by default handlers in |
| 80 // net::URLRequest. | 79 // net::URLRequest. |
| 81 static bool IsHandledURL(const GURL& url); | 80 static bool IsHandledURL(const GURL& url); |
| 82 | 81 |
| 82 // Called by Profile. |
| 83 const content::ResourceContext& GetResourceContext() const; |
| 84 ChromeURLDataManagerBackend* GetChromeURLDataManagerBackend() const; |
| 85 |
| 83 // These should only be called at most once each. Ownership is reversed when | 86 // These should only be called at most once each. Ownership is reversed when |
| 84 // they get called, from ProfileIOData owning ChromeURLRequestContext to vice | 87 // they get called, from ProfileIOData owning ChromeURLRequestContext to vice |
| 85 // versa. | 88 // versa. |
| 86 scoped_refptr<ChromeURLRequestContext> GetMainRequestContext() const; | 89 scoped_refptr<ChromeURLRequestContext> GetMainRequestContext() const; |
| 87 scoped_refptr<ChromeURLRequestContext> GetMediaRequestContext() const; | 90 scoped_refptr<ChromeURLRequestContext> GetMediaRequestContext() const; |
| 88 scoped_refptr<ChromeURLRequestContext> GetExtensionsRequestContext() const; | 91 scoped_refptr<ChromeURLRequestContext> GetExtensionsRequestContext() const; |
| 89 scoped_refptr<ChromeURLRequestContext> GetIsolatedAppRequestContext( | 92 scoped_refptr<ChromeURLRequestContext> GetIsolatedAppRequestContext( |
| 90 scoped_refptr<ChromeURLRequestContext> main_context, | 93 scoped_refptr<ChromeURLRequestContext> main_context, |
| 91 const std::string& app_id) const; | 94 const std::string& app_id) const; |
| 92 const content::ResourceContext& GetResourceContext() const; | |
| 93 | 95 |
| 94 // These are useful when the Chrome layer is called from the content layer | 96 // These are useful when the Chrome layer is called from the content layer |
| 95 // with a content::ResourceContext, and they want access to Chrome data for | 97 // with a content::ResourceContext, and they want access to Chrome data for |
| 96 // that profile. | 98 // that profile. |
| 97 ExtensionInfoMap* GetExtensionInfoMap() const; | 99 ExtensionInfoMap* GetExtensionInfoMap() const; |
| 98 HostContentSettingsMap* GetHostContentSettingsMap() const; | 100 HostContentSettingsMap* GetHostContentSettingsMap() const; |
| 99 DesktopNotificationService* GetNotificationService() const; | 101 DesktopNotificationService* GetNotificationService() const; |
| 100 | 102 |
| 101 BooleanPrefMember* clear_local_state_on_exit() const { | 103 BooleanPrefMember* clear_local_state_on_exit() const { |
| 102 return &clear_local_state_on_exit_; | 104 return &clear_local_state_on_exit_; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 // Weak pointers to the request contexts. Only valid after LazyInitialize. | 309 // Weak pointers to the request contexts. Only valid after LazyInitialize. |
| 308 // These are weak so that they don't hold a reference to the RequestContext, | 310 // These are weak so that they don't hold a reference to the RequestContext, |
| 309 // because that holds a reference back to ProfileIOData. | 311 // because that holds a reference back to ProfileIOData. |
| 310 mutable base::WeakPtr<ChromeURLRequestContext> | 312 mutable base::WeakPtr<ChromeURLRequestContext> |
| 311 weak_extensions_request_context_; | 313 weak_extensions_request_context_; |
| 312 | 314 |
| 313 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 315 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
| 314 }; | 316 }; |
| 315 | 317 |
| 316 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 318 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| OLD | NEW |