| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" | 5 #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "chrome/browser/in_process_webkit/webkit_context.h" | 10 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 last_storage_area_id_(0), | 30 last_storage_area_id_(0), |
| 31 last_storage_namespace_id_(0), | 31 last_storage_namespace_id_(0), |
| 32 ever_used_(false), | 32 ever_used_(false), |
| 33 shutdown_(false) { | 33 shutdown_(false) { |
| 34 DCHECK(webkit_context_.get()); | 34 DCHECK(webkit_context_.get()); |
| 35 DCHECK(webkit_thread_); | 35 DCHECK(webkit_thread_); |
| 36 DCHECK(message_sender_); | 36 DCHECK(message_sender_); |
| 37 } | 37 } |
| 38 | 38 |
| 39 DOMStorageDispatcherHost::~DOMStorageDispatcherHost() { | 39 DOMStorageDispatcherHost::~DOMStorageDispatcherHost() { |
| 40 DCHECK(!ever_used_ || ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); | |
| 41 DCHECK(shutdown_); | 40 DCHECK(shutdown_); |
| 41 // TODO(jorlow): This sometimes fails on the bots. Why?? |
| 42 //DCHECK(!ever_used_ || ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); |
| 42 } | 43 } |
| 43 | 44 |
| 44 void DOMStorageDispatcherHost::Shutdown() { | 45 void DOMStorageDispatcherHost::Shutdown() { |
| 45 if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { | 46 if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { |
| 46 message_sender_ = NULL; | 47 message_sender_ = NULL; |
| 47 if (!ever_used_) { | 48 if (!ever_used_) { |
| 48 shutdown_ = true; | 49 shutdown_ = true; |
| 49 return; | 50 return; |
| 50 } | 51 } |
| 51 | 52 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 return new_namespace_id; | 378 return new_namespace_id; |
| 378 } | 379 } |
| 379 | 380 |
| 380 WebString DOMStorageDispatcherHost::GetLocalStoragePath() { | 381 WebString DOMStorageDispatcherHost::GetLocalStoragePath() { |
| 381 const FilePath& path = webkit_context_->data_path(); | 382 const FilePath& path = webkit_context_->data_path(); |
| 382 if (path.empty()) | 383 if (path.empty()) |
| 383 return WebString(); | 384 return WebString(); |
| 384 FilePath::StringType path_string = path.AppendASCII("localStorage").value(); | 385 FilePath::StringType path_string = path.AppendASCII("localStorage").value(); |
| 385 return webkit_glue::FilePathStringToWebString(path_string); | 386 return webkit_glue::FilePathStringToWebString(path_string); |
| 386 } | 387 } |
| OLD | NEW |