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

Unified Diff: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications Created 11 years, 2 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: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
===================================================================
--- chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h (revision 30037)
+++ chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h (working copy)
@@ -7,12 +7,14 @@
#include "base/process.h"
#include "base/ref_counted.h"
+#include "base/tracked.h"
#include "chrome/browser/in_process_webkit/storage_area.h"
#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/common/dom_storage_type.h"
#include "ipc/ipc_message.h"
class DOMStorageContext;
+class Task;
class WebKitThread;
// This class handles the logistics of DOM Storage within the browser process.
@@ -69,10 +71,13 @@
// A shortcut for accessing our context.
DOMStorageContext* Context() {
- DCHECK(!shutdown_);
return webkit_context_->dom_storage_context();
}
+ // Posts a task to the WebKit thread, initializing it if necessary.
+ void PostTaskToWebKitThread(
+ const tracked_objects::Location& from_here, Task* task);
+
// Use whenever there's a chance OnStorageEvent will be called.
class AutoSetCurrentDispatcherHost {
public:
@@ -96,16 +101,6 @@
// handle.
base::ProcessHandle process_handle_;
- // Has this dispatcher ever handled a message. If not, then we can skip
- // the entire shutdown procedure. This is only set to true on the IO thread
- // and must be true if we're reading it on the WebKit thread.
- bool ever_used_;
-
- // This is set once the Shutdown routine runs on the WebKit thread. Once
- // set, we should not process any more messages because storage_area_map_
- // and storage_namespace_map_ contain pointers to deleted objects.
- bool shutdown_;
-
DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageDispatcherHost);
};

Powered by Google App Engine
This is Rietveld 408576698