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

Side by Side Diff: third_party/WebKit/Source/modules/storage/StorageArea.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All Rights Reserved. 2 * Copyright (C) 2009 Google Inc. All Rights Reserved.
3 * (C) 2008 Apple Inc. 3 * (C) 2008 Apple Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 25 matching lines...) Expand all
36 #include "modules/storage/InspectorDOMStorageAgent.h" 36 #include "modules/storage/InspectorDOMStorageAgent.h"
37 #include "modules/storage/Storage.h" 37 #include "modules/storage/Storage.h"
38 #include "modules/storage/StorageClient.h" 38 #include "modules/storage/StorageClient.h"
39 #include "modules/storage/StorageEvent.h" 39 #include "modules/storage/StorageEvent.h"
40 #include "modules/storage/StorageNamespace.h" 40 #include "modules/storage/StorageNamespace.h"
41 #include "modules/storage/StorageNamespaceController.h" 41 #include "modules/storage/StorageNamespaceController.h"
42 #include "platform/weborigin/SecurityOrigin.h" 42 #include "platform/weborigin/SecurityOrigin.h"
43 #include "public/platform/WebStorageArea.h" 43 #include "public/platform/WebStorageArea.h"
44 #include "public/platform/WebString.h" 44 #include "public/platform/WebString.h"
45 #include "public/platform/WebURL.h" 45 #include "public/platform/WebURL.h"
46 #include <memory>
47 46
48 namespace blink { 47 namespace blink {
49 48
50 StorageArea* StorageArea::create(std::unique_ptr<WebStorageArea> storageArea, St orageType storageType) 49 StorageArea* StorageArea::create(PassOwnPtr<WebStorageArea> storageArea, Storage Type storageType)
51 { 50 {
52 return new StorageArea(std::move(storageArea), storageType); 51 return new StorageArea(std::move(storageArea), storageType);
53 } 52 }
54 53
55 StorageArea::StorageArea(std::unique_ptr<WebStorageArea> storageArea, StorageTyp e storageType) 54 StorageArea::StorageArea(PassOwnPtr<WebStorageArea> storageArea, StorageType sto rageType)
56 : LocalFrameLifecycleObserver(nullptr) 55 : LocalFrameLifecycleObserver(nullptr)
57 , m_storageArea(std::move(storageArea)) 56 , m_storageArea(std::move(storageArea))
58 , m_storageType(storageType) 57 , m_storageType(storageType)
59 , m_canAccessStorageCachedResult(false) 58 , m_canAccessStorageCachedResult(false)
60 { 59 {
61 } 60 }
62 61
63 StorageArea::~StorageArea() 62 StorageArea::~StorageArea()
64 { 63 {
65 } 64 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 localFrame->localDOMWindow()->enqueueWindowEvent(StorageEvent::creat e(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage)); 202 localFrame->localDOMWindow()->enqueueWindowEvent(StorageEvent::creat e(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage));
204 } 203 }
205 if (InspectorDOMStorageAgent* agent = StorageNamespaceController::from(page) ->inspectorAgent()) 204 if (InspectorDOMStorageAgent* agent = StorageNamespaceController::from(page) ->inspectorAgent())
206 agent->didDispatchDOMStorageEvent(key, oldValue, newValue, SessionStorag e, securityOrigin); 205 agent->didDispatchDOMStorageEvent(key, oldValue, newValue, SessionStorag e, securityOrigin);
207 } 206 }
208 207
209 bool StorageArea::isEventSource(Storage* storage, WebStorageArea* sourceAreaInst ance) 208 bool StorageArea::isEventSource(Storage* storage, WebStorageArea* sourceAreaInst ance)
210 { 209 {
211 ASSERT(storage); 210 ASSERT(storage);
212 StorageArea* area = storage->area(); 211 StorageArea* area = storage->area();
213 return area->m_storageArea.get() == sourceAreaInstance; 212 return area->m_storageArea == sourceAreaInstance;
214 } 213 }
215 214
216 } // namespace blink 215 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/storage/StorageArea.h ('k') | third_party/WebKit/Source/modules/storage/StorageClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698