Commit 890146b1 authored by pilgrim@chromium.org's avatar pilgrim@chromium.org

Move blob_storage_host from webkit/ to content/

BUG=338338
TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/231923002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262978 0039d316-1c4b-4281-b951-d872f2087c98
parent b44f1d38
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -7,12 +7,14 @@ ...@@ -7,12 +7,14 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "content/browser/fileapi/blob_storage_host.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "webkit/browser/blob/blob_data_handle.h" #include "webkit/browser/blob/blob_data_handle.h"
#include "webkit/browser/blob/blob_storage_context.h" #include "webkit/browser/blob/blob_storage_context.h"
#include "webkit/browser/blob/blob_storage_host.h"
namespace webkit_blob { using webkit_blob::BlobDataHandle;
namespace content {
namespace { namespace {
void SetupBasicBlob(BlobStorageHost* host, const std::string& id) { void SetupBasicBlob(BlobStorageHost* host, const std::string& id) {
...@@ -205,4 +207,4 @@ TEST(BlobStorageContextTest, EarlyContextDeletion) { ...@@ -205,4 +207,4 @@ TEST(BlobStorageContextTest, EarlyContextDeletion) {
// TODO(michaeln): tests for the depcrecated url stuff // TODO(michaeln): tests for the depcrecated url stuff
} // namespace webkit_blob } // namespace content
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "webkit/browser/blob/blob_storage_host.h" #include "content/browser/fileapi/blob_storage_host.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
#include "webkit/browser/blob/blob_data_handle.h" #include "webkit/browser/blob/blob_data_handle.h"
#include "webkit/browser/blob/blob_storage_context.h" #include "webkit/browser/blob/blob_storage_context.h"
namespace webkit_blob { using webkit_blob::BlobStorageContext;
using webkit_blob::BlobData;
namespace content {
BlobStorageHost::BlobStorageHost(BlobStorageContext* context) BlobStorageHost::BlobStorageHost(BlobStorageContext* context)
: context_(context->AsWeakPtr()) { : context_(context->AsWeakPtr()) {
...@@ -111,4 +114,4 @@ bool BlobStorageHost::IsUrlRegisteredInHost(const GURL& blob_url) { ...@@ -111,4 +114,4 @@ bool BlobStorageHost::IsUrlRegisteredInHost(const GURL& blob_url) {
return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); return public_blob_urls_.find(blob_url) != public_blob_urls_.end();
} }
} // namespace webkit_blob } // namespace content
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ #ifndef CONTENT_BROWSER_FILEAPI_STORAGE_HOST_H_
#define WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ #define CONTENT_BROWSER_FILEAPI_STORAGE_HOST_H_
#include <map> #include <map>
#include <set> #include <set>
...@@ -11,23 +11,28 @@ ...@@ -11,23 +11,28 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "webkit/browser/webkit_storage_browser_export.h" #include "content/common/content_export.h"
#include "webkit/common/blob/blob_data.h" #include "webkit/common/blob/blob_data.h"
class GURL; class GURL;
namespace webkit_blob { namespace webkit_blob {
class BlobDataHandle; class BlobDataHandle;
class BlobStorageHost; class BlobStorageHost;
class BlobStorageContext; class BlobStorageContext;
}
using webkit_blob::BlobStorageContext;
using webkit_blob::BlobData;
namespace content {
// This class handles the logistics of blob storage for a single child process. // This class handles the logistics of blob storage for a single child process.
// There is one instance per child process. When the child process // There is one instance per child process. When the child process
// terminates all blob references attibutable to that process go away upon // terminates all blob references attibutable to that process go away upon
// destruction of the instance. The class is single threaded and should // destruction of the instance. The class is single threaded and should
// only be used on the IO thread. // only be used on the IO thread.
class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageHost { class CONTENT_EXPORT BlobStorageHost {
public: public:
explicit BlobStorageHost(BlobStorageContext* context); explicit BlobStorageHost(BlobStorageContext* context);
~BlobStorageHost(); ~BlobStorageHost();
...@@ -66,6 +71,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageHost { ...@@ -66,6 +71,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageHost {
DISALLOW_COPY_AND_ASSIGN(BlobStorageHost); DISALLOW_COPY_AND_ASSIGN(BlobStorageHost);
}; };
} // namespace webkit_blob } // namespace content
#endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ #endif // CONTENT_BROWSER_FILEAPI_STORAGE_HOST_H_
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "content/browser/child_process_security_policy_impl.h" #include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/fileapi/blob_storage_host.h"
#include "content/browser/fileapi/browser_file_system_helper.h" #include "content/browser/fileapi/browser_file_system_helper.h"
#include "content/browser/fileapi/chrome_blob_storage_context.h" #include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/streams/stream_registry.h" #include "content/browser/streams/stream_registry.h"
...@@ -29,7 +30,6 @@ ...@@ -29,7 +30,6 @@
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
#include "url/gurl.h" #include "url/gurl.h"
#include "webkit/browser/blob/blob_storage_context.h" #include "webkit/browser/blob/blob_storage_context.h"
#include "webkit/browser/blob/blob_storage_host.h"
#include "webkit/browser/fileapi/file_observers.h" #include "webkit/browser/fileapi/file_observers.h"
#include "webkit/browser/fileapi/file_permission_policy.h" #include "webkit/browser/fileapi/file_permission_policy.h"
#include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_context.h"
...@@ -47,7 +47,6 @@ using fileapi::FileSystemOperation; ...@@ -47,7 +47,6 @@ using fileapi::FileSystemOperation;
using fileapi::FileSystemURL; using fileapi::FileSystemURL;
using webkit_blob::BlobData; using webkit_blob::BlobData;
using webkit_blob::BlobStorageContext; using webkit_blob::BlobStorageContext;
using webkit_blob::BlobStorageHost;
namespace content { namespace content {
......
...@@ -44,8 +44,11 @@ class URLRequestContext; ...@@ -44,8 +44,11 @@ class URLRequestContext;
class URLRequestContextGetter; class URLRequestContextGetter;
} // namespace net } // namespace net
namespace webkit_blob { namespace content {
class BlobStorageHost; class BlobStorageHost;
}
namespace webkit_blob {
class ShareableFileReference; class ShareableFileReference;
} }
...@@ -229,7 +232,7 @@ class CONTENT_EXPORT FileAPIMessageFilter : public BrowserMessageFilter { ...@@ -229,7 +232,7 @@ class CONTENT_EXPORT FileAPIMessageFilter : public BrowserMessageFilter {
// Keeps track of blobs used in this process and cleans up // Keeps track of blobs used in this process and cleans up
// when the renderer process dies. // when the renderer process dies.
scoped_ptr<webkit_blob::BlobStorageHost> blob_storage_host_; scoped_ptr<BlobStorageHost> blob_storage_host_;
// Keep track of stream URLs registered in this process. Need to unregister // Keep track of stream URLs registered in this process. Need to unregister
// all of them when the renderer process dies. // all of them when the renderer process dies.
......
...@@ -521,6 +521,8 @@ ...@@ -521,6 +521,8 @@
'browser/download/save_package.h', 'browser/download/save_package.h',
'browser/download/save_types.cc', 'browser/download/save_types.cc',
'browser/download/save_types.h', 'browser/download/save_types.h',
'browser/fileapi/blob_storage_host.cc',
'browser/fileapi/blob_storage_host.h',
'browser/fileapi/browser_file_system_helper.cc', 'browser/fileapi/browser_file_system_helper.cc',
'browser/fileapi/browser_file_system_helper.h', 'browser/fileapi/browser_file_system_helper.h',
'browser/fileapi/chrome_blob_storage_context.cc', 'browser/fileapi/chrome_blob_storage_context.cc',
......
...@@ -379,6 +379,7 @@ ...@@ -379,6 +379,7 @@
'browser/download/file_metadata_unittest_linux.cc', 'browser/download/file_metadata_unittest_linux.cc',
'browser/download/rate_estimator_unittest.cc', 'browser/download/rate_estimator_unittest.cc',
'browser/download/save_package_unittest.cc', 'browser/download/save_package_unittest.cc',
'browser/fileapi/blob_storage_context_unittest.cc',
'browser/fileapi/blob_url_request_job_unittest.cc', 'browser/fileapi/blob_url_request_job_unittest.cc',
'browser/fileapi/copy_or_move_file_validator_unittest.cc', 'browser/fileapi/copy_or_move_file_validator_unittest.cc',
'browser/fileapi/copy_or_move_operation_delegate_unittest.cc', 'browser/fileapi/copy_or_move_operation_delegate_unittest.cc',
...@@ -632,7 +633,6 @@ ...@@ -632,7 +633,6 @@
'../webkit/browser/appcache/mock_appcache_storage.cc', '../webkit/browser/appcache/mock_appcache_storage.cc',
'../webkit/browser/appcache/mock_appcache_storage.h', '../webkit/browser/appcache/mock_appcache_storage.h',
'../webkit/browser/appcache/mock_appcache_storage_unittest.cc', '../webkit/browser/appcache/mock_appcache_storage_unittest.cc',
'../webkit/browser/blob/blob_storage_context_unittest.cc',
'../webkit/browser/blob/local_file_stream_reader_unittest.cc', '../webkit/browser/blob/local_file_stream_reader_unittest.cc',
'../webkit/browser/database/database_quota_client_unittest.cc', '../webkit/browser/database/database_quota_client_unittest.cc',
'../webkit/browser/database/database_tracker_unittest.cc', '../webkit/browser/database/database_tracker_unittest.cc',
......
...@@ -22,6 +22,10 @@ class FilePath; ...@@ -22,6 +22,10 @@ class FilePath;
class Time; class Time;
} }
namespace content {
class BlobStorageHost;
}
namespace webkit_blob { namespace webkit_blob {
class BlobDataHandle; class BlobDataHandle;
...@@ -48,8 +52,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageContext ...@@ -48,8 +52,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageContext
void RevokePublicBlobURL(const GURL& url); void RevokePublicBlobURL(const GURL& url);
private: private:
friend class content::BlobStorageHost;
friend class BlobDataHandle; friend class BlobDataHandle;
friend class BlobStorageHost;
friend class ViewBlobInternalsJob; friend class ViewBlobInternalsJob;
enum EntryFlags { enum EntryFlags {
......
...@@ -67,8 +67,6 @@ ...@@ -67,8 +67,6 @@
'browser/blob/blob_data_handle.h', 'browser/blob/blob_data_handle.h',
'browser/blob/blob_storage_context.cc', 'browser/blob/blob_storage_context.cc',
'browser/blob/blob_storage_context.h', 'browser/blob/blob_storage_context.h',
'browser/blob/blob_storage_host.cc',
'browser/blob/blob_storage_host.h',
'browser/blob/blob_url_request_job.cc', 'browser/blob/blob_url_request_job.cc',
'browser/blob/blob_url_request_job.h', 'browser/blob/blob_url_request_job.h',
'browser/blob/blob_url_request_job_factory.cc', 'browser/blob/blob_url_request_job_factory.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment