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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 else | 185 else |
186 somethingCleared = false; | 186 somethingCleared = false; |
187 } | 187 } |
188 | 188 |
189 // SimpleDomStorageSystem ----------------------------- | 189 // SimpleDomStorageSystem ----------------------------- |
190 | 190 |
191 SimpleDomStorageSystem* SimpleDomStorageSystem::g_instance_; | 191 SimpleDomStorageSystem* SimpleDomStorageSystem::g_instance_; |
192 | 192 |
193 SimpleDomStorageSystem::SimpleDomStorageSystem() | 193 SimpleDomStorageSystem::SimpleDomStorageSystem() |
194 : weak_factory_(this), | 194 : weak_factory_(this), |
195 context_(new DomStorageContext(FilePath(), NULL, NULL)), | 195 context_(new DomStorageContext(FilePath(), FilePath(), NULL, NULL)), |
196 host_(new DomStorageHost(context_)) { | 196 host_(new DomStorageHost(context_)) { |
197 DCHECK(!g_instance_); | 197 DCHECK(!g_instance_); |
198 g_instance_ = this; | 198 g_instance_ = this; |
199 } | 199 } |
200 | 200 |
201 SimpleDomStorageSystem::~SimpleDomStorageSystem() { | 201 SimpleDomStorageSystem::~SimpleDomStorageSystem() { |
202 g_instance_ = NULL; | 202 g_instance_ = NULL; |
203 host_.reset(); | 203 host_.reset(); |
204 } | 204 } |
205 | 205 |
206 WebStorageNamespace* SimpleDomStorageSystem::CreateLocalStorageNamespace() { | 206 WebStorageNamespace* SimpleDomStorageSystem::CreateLocalStorageNamespace() { |
207 return new NamespaceImpl(weak_factory_.GetWeakPtr()); | 207 return new NamespaceImpl(weak_factory_.GetWeakPtr()); |
208 } | 208 } |
209 | 209 |
210 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() { | 210 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() { |
211 int id = context_->AllocateSessionId(); | 211 int id = context_->AllocateSessionId(); |
212 context_->CreateSessionNamespace(id); | 212 context_->CreateSessionNamespace(id); |
213 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id); | 213 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id); |
214 } | 214 } |
OLD | NEW |