OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/supports_user_data.h" | 11 #include "base/supports_user_data.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/public/browser/zoom_level_delegate.h" | 13 #include "content/public/browser/zoom_level_delegate.h" |
14 #include "content/public/common/push_messaging_status.h" | 14 #include "content/public/common/push_messaging_status.h" |
15 | 15 |
16 class GURL; | 16 class GURL; |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class FilePath; | 19 class FilePath; |
| 20 class Time; |
20 } | 21 } |
21 | 22 |
22 namespace storage { | 23 namespace storage { |
23 class ExternalMountPoints; | 24 class ExternalMountPoints; |
24 } | 25 } |
25 | 26 |
26 namespace net { | 27 namespace net { |
27 class URLRequestContextGetter; | 28 class URLRequestContextGetter; |
28 } | 29 } |
29 | 30 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 static content::StoragePartition* GetDefaultStoragePartition( | 82 static content::StoragePartition* GetDefaultStoragePartition( |
82 BrowserContext* browser_context); | 83 BrowserContext* browser_context); |
83 | 84 |
84 typedef base::Callback<void(scoped_ptr<BlobHandle>)> BlobCallback; | 85 typedef base::Callback<void(scoped_ptr<BlobHandle>)> BlobCallback; |
85 | 86 |
86 // |callback| returns a nullptr scoped_ptr on failure. | 87 // |callback| returns a nullptr scoped_ptr on failure. |
87 static void CreateMemoryBackedBlob(BrowserContext* browser_context, | 88 static void CreateMemoryBackedBlob(BrowserContext* browser_context, |
88 const char* data, size_t length, | 89 const char* data, size_t length, |
89 const BlobCallback& callback); | 90 const BlobCallback& callback); |
90 | 91 |
| 92 // |callback| returns a nullptr scoped_ptr on failure. |
| 93 static void CreateFileBackedBlob(BrowserContext* browser_context, |
| 94 const base::FilePath& path, |
| 95 int64_t offset, |
| 96 int64_t size, |
| 97 const base::Time& expected_modification_time, |
| 98 const BlobCallback& callback); |
| 99 |
91 // Delivers a push message with |data| to the Service Worker identified by | 100 // Delivers a push message with |data| to the Service Worker identified by |
92 // |origin| and |service_worker_registration_id|. | 101 // |origin| and |service_worker_registration_id|. |
93 static void DeliverPushMessage( | 102 static void DeliverPushMessage( |
94 BrowserContext* browser_context, | 103 BrowserContext* browser_context, |
95 const GURL& origin, | 104 const GURL& origin, |
96 int64 service_worker_registration_id, | 105 int64 service_worker_registration_id, |
97 const std::string& data, | 106 const std::string& data, |
98 const base::Callback<void(PushDeliveryStatus)>& callback); | 107 const base::Callback<void(PushDeliveryStatus)>& callback); |
99 | 108 |
100 static void NotifyWillBeDestroyed(BrowserContext* browser_context); | 109 static void NotifyWillBeDestroyed(BrowserContext* browser_context); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 virtual PushMessagingService* GetPushMessagingService() = 0; | 179 virtual PushMessagingService* GetPushMessagingService() = 0; |
171 | 180 |
172 // Returns the SSL host state decisions for this context. The context may | 181 // Returns the SSL host state decisions for this context. The context may |
173 // return nullptr, implementing the default exception storage strategy. | 182 // return nullptr, implementing the default exception storage strategy. |
174 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; | 183 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; |
175 }; | 184 }; |
176 | 185 |
177 } // namespace content | 186 } // namespace content |
178 | 187 |
179 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 188 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
OLD | NEW |