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

Unified Diff: content/browser/appcache/appcache_executable_handler_impl.h

Issue 22314003: NavigationController prototype Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NavController prototype - chrome side Created 7 years, 3 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/appcache/appcache_executable_handler_impl.h
diff --git a/content/browser/appcache/appcache_executable_handler_impl.h b/content/browser/appcache/appcache_executable_handler_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..d29eba8634f91539c46776cda6df6e7b9d7580cd
--- /dev/null
+++ b/content/browser/appcache/appcache_executable_handler_impl.h
@@ -0,0 +1,96 @@
+// Copyright (c) 2013 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.
+
+#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_IMPL_H_
+#define CONTENT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_IMPL_H_
+
+#include <set>
+
+#include "content/browser/worker_host/worker_storage_partition.h"
+#include "content/public/browser/worker_service_observer.h"
+#include "webkit/browser/appcache/appcache_executable_handler.h"
+
+namespace content {
+
+class ChromeBlobStorageContext;
+class ResourceContext;
+class WorkerStoragePartition;
+
+class AppCacheExecutableHandlerFactoryImpl
+ : public appcache::AppCacheExecutableHandlerFactory {
+ public:
+ AppCacheExecutableHandlerFactoryImpl(
+ ResourceContext* resource_context,
+ const WorkerStoragePartition& partition,
+ ChromeBlobStorageContext* blob_context);
+ virtual ~AppCacheExecutableHandlerFactoryImpl();
+ virtual scoped_ptr<appcache::AppCacheExecutableHandler> CreateHandler(
+ int64 appcache_id,
+ const GURL& handler_url,
+ const std::string& raw_handler_source) OVERRIDE;
+
+ virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE;
+ virtual webkit_blob::BlobStorageController* GetBlobStorageController()
+ OVERRIDE;
+
+ private:
+ ResourceContext* resource_context_;
+ ChromeAppCacheService* appcache_service_;
+ WorkerStoragePartition partition_;
+ scoped_refptr<ChromeBlobStorageContext> blob_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppCacheExecutableHandlerFactoryImpl);
+};
+
+class AppCacheExecutableHandlerImpl
+ : public appcache::AppCacheExecutableHandler,
+ public WorkerServiceObserver {
+ public:
+ virtual ~AppCacheExecutableHandlerImpl();
+ virtual void HandleRequest(const Request& req,
+ ResponseCallback user_callback) OVERRIDE;
+
+ // Called the a message filter to plumb the exe handler's response
+ // back to our caller.
+ static void ProcessResponse(int request_id, const Response& resp);
+
+ // WorkerServiceObserver methods
+ virtual void WorkerDestroyed(int process_id, int route_id) OVERRIDE;
+
+ private:
+ friend class AppCacheExecutableHandlerFactoryImpl;
+ AppCacheExecutableHandlerImpl(
+ int64 appcache_id,
+ const GURL& handler_url,
+ const std::string& raw_handler_source,
+ ResourceContext* resource_context,
+ ChromeAppCacheService* appcache_service,
+ WorkerStoragePartition* partition);
+ AppCacheExecutableHandlerImpl();
+
+ void EnsureWorkerStarted();
+ void CallbackAdapter(int request_id, ResponseCallback user_callback,
+ const Response& resp);
+ void ClearCallbacks();
+
+ int worker_route_id_;
+
+ // all needed to restart the worker in case it goes down
+ const int64 appcache_id_;
+ const GURL handler_url_;
+ const std::string raw_handler_source_;
+
+ // these is ugly and depends on the factory outliving the handler
+ ResourceContext* resource_context_; // could be const?
+ ChromeAppCacheService* appcache_service_;
+ const WorkerStoragePartition* partition_;
+
+ // needed for cleanup on destruction or when the thread dies
+ std::set<int> pending_request_ids_;
+ DISALLOW_COPY_AND_ASSIGN(AppCacheExecutableHandlerImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_
« no previous file with comments | « content/browser/appcache/appcache_dispatcher_host.cc ('k') | content/browser/appcache/appcache_executable_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698