Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / browser / browser_context.cc
index dbc5949..8acae2d 100644 (file)
@@ -9,6 +9,7 @@
 #include "content/browser/fileapi/chrome_blob_storage_context.h"
 #include "content/browser/indexed_db/indexed_db_context_impl.h"
 #include "content/browser/loader/resource_dispatcher_host_impl.h"
+#include "content/browser/push_messaging_router.h"
 #include "content/browser/storage_partition_impl_map.h"
 #include "content/common/child_process_host_impl.h"
 #include "content/public/browser/blob_handle.h"
@@ -17,8 +18,8 @@
 #include "content/public/browser/site_instance.h"
 #include "net/cookies/cookie_monster.h"
 #include "net/cookies/cookie_store.h"
-#include "net/ssl/server_bound_cert_service.h"
-#include "net/ssl/server_bound_cert_store.h"
+#include "net/ssl/channel_id_service.h"
+#include "net/ssl/channel_id_store.h"
 #include "net/url_request/url_request_context.h"
 #include "net/url_request/url_request_context_getter.h"
 #include "webkit/browser/database/database_tracker.h"
@@ -69,11 +70,11 @@ StoragePartition* GetStoragePartitionFromConfig(
 
 void SaveSessionStateOnIOThread(
     const scoped_refptr<net::URLRequestContextGetter>& context_getter,
-    appcache::AppCacheServiceImpl* appcache_service) {
+    AppCacheServiceImpl* appcache_service) {
   net::URLRequestContext* context = context_getter->GetURLRequestContext();
   context->cookie_store()->GetCookieMonster()->
       SetForceKeepSessionState();
-  context->server_bound_cert_service()->GetCertStore()->
+  context->channel_id_service()->GetChannelIDStore()->
       SetForceKeepSessionState();
   appcache_service->set_force_keep_session_state();
 }
@@ -212,6 +213,18 @@ void BrowserContext::CreateMemoryBackedBlob(BrowserContext* browser_context,
       callback);
 }
 
+// static
+void BrowserContext::DeliverPushMessage(
+    BrowserContext* browser_context,
+    const GURL& origin,
+    int64 service_worker_registration_id,
+    const std::string& data,
+    const base::Callback<void(PushMessagingStatus)>& callback) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  PushMessagingRouter::DeliverMessage(
+      browser_context, origin, service_worker_registration_id, data, callback);
+}
+
 void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) {
   // This will be enough to tickle initialization of BrowserContext if
   // necessary, which initializes ResourceContext. The reason we don't call
@@ -236,7 +249,7 @@ void BrowserContext::SaveSessionState(BrowserContext* browser_context) {
         base::Bind(
             &SaveSessionStateOnIOThread,
             make_scoped_refptr(browser_context->GetRequestContext()),
-            static_cast<appcache::AppCacheServiceImpl*>(
+            static_cast<AppCacheServiceImpl*>(
                 storage_partition->GetAppCacheService())));
   }