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

Side by Side Diff: webkit/support/simple_dom_storage_system.cc

Issue 16415016: Move nullable_string16.h to the string subdirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/support/simple_dom_storage_system.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/support/simple_dom_storage_system.h" 5 #include "webkit/support/simple_dom_storage_system.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "third_party/WebKit/public/platform/WebStorageArea.h" 9 #include "third_party/WebKit/public/platform/WebStorageArea.h"
10 #include "third_party/WebKit/public/platform/WebStorageNamespace.h" 10 #include "third_party/WebKit/public/platform/WebStorageNamespace.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 unsigned SimpleDomStorageSystem::AreaImpl::length() { 139 unsigned SimpleDomStorageSystem::AreaImpl::length() {
140 if (Host()) 140 if (Host())
141 return Host()->GetAreaLength(connection_id_); 141 return Host()->GetAreaLength(connection_id_);
142 return 0; 142 return 0;
143 } 143 }
144 144
145 WebString SimpleDomStorageSystem::AreaImpl::key(unsigned index) { 145 WebString SimpleDomStorageSystem::AreaImpl::key(unsigned index) {
146 if (Host()) 146 if (Host())
147 return Host()->GetAreaKey(connection_id_, index); 147 return Host()->GetAreaKey(connection_id_, index);
148 return NullableString16(true); 148 return base::NullableString16(true);
149 } 149 }
150 150
151 WebString SimpleDomStorageSystem::AreaImpl::getItem(const WebString& key) { 151 WebString SimpleDomStorageSystem::AreaImpl::getItem(const WebString& key) {
152 if (Host()) 152 if (Host())
153 return Host()->GetAreaItem(connection_id_, key); 153 return Host()->GetAreaItem(connection_id_, key);
154 return NullableString16(true); 154 return base::NullableString16(true);
155 } 155 }
156 156
157 void SimpleDomStorageSystem::AreaImpl::setItem( 157 void SimpleDomStorageSystem::AreaImpl::setItem(
158 const WebString& key, const WebString& newValue, 158 const WebString& key, const WebString& newValue,
159 const WebURL& pageUrl, Result& result) { 159 const WebURL& pageUrl, Result& result) {
160 result = ResultBlockedByQuota; 160 result = ResultBlockedByQuota;
161 if (!Host()) 161 if (!Host())
162 return; 162 return;
163 163
164 base::AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this); 164 base::AutoReset<AreaImpl*> auto_reset(&parent_->area_being_processed_, this);
165 NullableString16 unused; 165 base::NullableString16 unused;
166 if (!Host()->SetAreaItem(connection_id_, key, newValue, pageUrl, 166 if (!Host()->SetAreaItem(connection_id_, key, newValue, pageUrl,
167 &unused)) 167 &unused))
168 return; 168 return;
169 169
170 result = ResultOK; 170 result = ResultOK;
171 } 171 }
172 172
173 void SimpleDomStorageSystem::AreaImpl::removeItem( 173 void SimpleDomStorageSystem::AreaImpl::removeItem(
174 const WebString& key, const WebURL& pageUrl) { 174 const WebString& key, const WebURL& pageUrl) {
175 if (!Host()) 175 if (!Host())
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() { 219 WebStorageNamespace* SimpleDomStorageSystem::CreateSessionStorageNamespace() {
220 int id = context_->AllocateSessionId(); 220 int id = context_->AllocateSessionId();
221 context_->CreateSessionNamespace(id, std::string()); 221 context_->CreateSessionNamespace(id, std::string());
222 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id); 222 return new NamespaceImpl(weak_factory_.GetWeakPtr(), id);
223 } 223 }
224 224
225 void SimpleDomStorageSystem::OnDomStorageItemSet( 225 void SimpleDomStorageSystem::OnDomStorageItemSet(
226 const dom_storage::DomStorageArea* area, 226 const dom_storage::DomStorageArea* area,
227 const base::string16& key, 227 const base::string16& key,
228 const base::string16& new_value, 228 const base::string16& new_value,
229 const NullableString16& old_value, 229 const base::NullableString16& old_value,
230 const GURL& page_url) { 230 const GURL& page_url) {
231 DispatchDomStorageEvent(area, page_url, 231 DispatchDomStorageEvent(area, page_url,
232 NullableString16(key, false), 232 base::NullableString16(key, false),
233 NullableString16(new_value, false), 233 base::NullableString16(new_value, false),
234 old_value); 234 old_value);
235 } 235 }
236 236
237 void SimpleDomStorageSystem::OnDomStorageItemRemoved( 237 void SimpleDomStorageSystem::OnDomStorageItemRemoved(
238 const dom_storage::DomStorageArea* area, 238 const dom_storage::DomStorageArea* area,
239 const base::string16& key, 239 const base::string16& key,
240 const base::string16& old_value, 240 const base::string16& old_value,
241 const GURL& page_url) { 241 const GURL& page_url) {
242 DispatchDomStorageEvent(area, page_url, 242 DispatchDomStorageEvent(area, page_url,
243 NullableString16(key, false), 243 base::NullableString16(key, false),
244 NullableString16(true), 244 base::NullableString16(true),
245 NullableString16(old_value, false)); 245 base::NullableString16(old_value, false));
246 } 246 }
247 247
248 void SimpleDomStorageSystem::OnDomStorageAreaCleared( 248 void SimpleDomStorageSystem::OnDomStorageAreaCleared(
249 const dom_storage::DomStorageArea* area, 249 const dom_storage::DomStorageArea* area,
250 const GURL& page_url) { 250 const GURL& page_url) {
251 DispatchDomStorageEvent(area, page_url, 251 DispatchDomStorageEvent(area, page_url,
252 NullableString16(true), 252 base::NullableString16(true),
253 NullableString16(true), 253 base::NullableString16(true),
254 NullableString16(true)); 254 base::NullableString16(true));
255 } 255 }
256 256
257 void SimpleDomStorageSystem::DispatchDomStorageEvent( 257 void SimpleDomStorageSystem::DispatchDomStorageEvent(
258 const dom_storage::DomStorageArea* area, 258 const dom_storage::DomStorageArea* area,
259 const GURL& page_url, 259 const GURL& page_url,
260 const NullableString16& key, 260 const base::NullableString16& key,
261 const NullableString16& new_value, 261 const base::NullableString16& new_value,
262 const NullableString16& old_value) { 262 const base::NullableString16& old_value) {
263 DCHECK(area_being_processed_); 263 DCHECK(area_being_processed_);
264 if (area->namespace_id() == dom_storage::kLocalStorageNamespaceId) { 264 if (area->namespace_id() == dom_storage::kLocalStorageNamespaceId) {
265 WebStorageEventDispatcher::dispatchLocalStorageEvent( 265 WebStorageEventDispatcher::dispatchLocalStorageEvent(
266 key, 266 key,
267 old_value, 267 old_value,
268 new_value, 268 new_value,
269 area->origin(), 269 area->origin(),
270 page_url, 270 page_url,
271 area_being_processed_, 271 area_being_processed_,
272 true /* originatedInProcess */); 272 true /* originatedInProcess */);
273 } else { 273 } else {
274 NamespaceImpl session_namespace_for_event_dispatch( 274 NamespaceImpl session_namespace_for_event_dispatch(
275 base::WeakPtr<SimpleDomStorageSystem>(), area->namespace_id()); 275 base::WeakPtr<SimpleDomStorageSystem>(), area->namespace_id());
276 WebStorageEventDispatcher::dispatchSessionStorageEvent( 276 WebStorageEventDispatcher::dispatchSessionStorageEvent(
277 key, 277 key,
278 old_value, 278 old_value,
279 new_value, 279 new_value,
280 area->origin(), 280 area->origin(),
281 page_url, 281 page_url,
282 session_namespace_for_event_dispatch, 282 session_namespace_for_event_dispatch,
283 area_being_processed_, 283 area_being_processed_,
284 true /* originatedInProcess */); 284 true /* originatedInProcess */);
285 } 285 }
286 } 286 }
OLDNEW
« no previous file with comments | « webkit/support/simple_dom_storage_system.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698