OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/tools/test_shell/simple_dom_storage_system.h" | 5 #include "webkit/tools/test_shell/simple_dom_storage_system.h" |
6 | 6 |
7 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 else | 184 else |
185 somethingCleared = false; | 185 somethingCleared = false; |
186 } | 186 } |
187 | 187 |
188 // SimpleDomStorageSystem ----------------------------- | 188 // SimpleDomStorageSystem ----------------------------- |
189 | 189 |
190 SimpleDomStorageSystem* SimpleDomStorageSystem::g_instance_; | 190 SimpleDomStorageSystem* SimpleDomStorageSystem::g_instance_; |
191 | 191 |
192 SimpleDomStorageSystem::SimpleDomStorageSystem() | 192 SimpleDomStorageSystem::SimpleDomStorageSystem() |
193 : weak_factory_(this), | 193 : weak_factory_(this), |
194 context_(new DomStorageContext(FilePath(), NULL, NULL)), | 194 context_(new DomStorageContext(FilePath(), FilePath(), NULL, NULL)), |
195 host_(new DomStorageHost(context_)) { | 195 host_(new DomStorageHost(context_)) { |
196 DCHECK(!g_instance_); | 196 DCHECK(!g_instance_); |
197 g_instance_ = this; | 197 g_instance_ = this; |
198 } | 198 } |
199 | 199 |
200 SimpleDomStorageSystem::~SimpleDomStorageSystem() { | 200 SimpleDomStorageSystem::~SimpleDomStorageSystem() { |
201 g_instance_ = NULL; | 201 g_instance_ = NULL; |
202 host_.reset(); | 202 host_.reset(); |
203 } | 203 } |
204 | 204 |
205 WebStorageNamespace* SimpleDomStorageSystem::CreateLocalStorageNamespace() { | 205 WebStorageNamespace* SimpleDomStorageSystem::CreateLocalStorageNamespace() { |
206 return new NamespaceImpl(weak_factory_.GetWeakPtr()); | 206 return new NamespaceImpl(weak_factory_.GetWeakPtr()); |
207 } | 207 } |
208 | 208 |
209 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() { | 209 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() { |
210 int id = context_->AllocateSessionId(); | 210 int id = context_->AllocateSessionId(); |
211 context_->CreateSessionNamespace(id); | 211 context_->CreateSessionNamespace(id); |
212 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id); | 212 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id); |
213 } | 213 } |
OLD | NEW |