OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "modules/storage/InspectorDOMStorageAgent.h" | 30 #include "modules/storage/InspectorDOMStorageAgent.h" |
31 | 31 |
32 #include "bindings/core/v8/ExceptionState.h" | 32 #include "bindings/core/v8/ExceptionState.h" |
33 #include "core/InspectorFrontend.h" | 33 #include "core/InspectorFrontend.h" |
34 #include "core/dom/DOMException.h" | 34 #include "core/dom/DOMException.h" |
35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
37 #include "core/frame/LocalDOMWindow.h" | 37 #include "core/frame/LocalDOMWindow.h" |
38 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
39 #include "core/inspector/InspectedFrames.h" | 39 #include "core/inspector/InspectedFrames.h" |
40 #include "core/inspector/InspectorState.h" | |
41 #include "core/page/Page.h" | 40 #include "core/page/Page.h" |
42 #include "modules/storage/Storage.h" | 41 #include "modules/storage/Storage.h" |
43 #include "modules/storage/StorageNamespace.h" | 42 #include "modules/storage/StorageNamespace.h" |
44 #include "modules/storage/StorageNamespaceController.h" | 43 #include "modules/storage/StorageNamespaceController.h" |
45 #include "platform/JSONValues.h" | 44 #include "platform/JSONValues.h" |
46 #include "platform/weborigin/SecurityOrigin.h" | 45 #include "platform/weborigin/SecurityOrigin.h" |
47 | 46 |
48 namespace blink { | 47 namespace blink { |
49 | 48 |
50 namespace DOMStorageAgentState { | 49 namespace DOMStorageAgentState { |
(...skipping 27 matching lines...) Expand all Loading... |
78 } | 77 } |
79 | 78 |
80 DEFINE_TRACE(InspectorDOMStorageAgent) | 79 DEFINE_TRACE(InspectorDOMStorageAgent) |
81 { | 80 { |
82 visitor->trace(m_page); | 81 visitor->trace(m_page); |
83 InspectorBaseAgent::trace(visitor); | 82 InspectorBaseAgent::trace(visitor); |
84 } | 83 } |
85 | 84 |
86 void InspectorDOMStorageAgent::restore() | 85 void InspectorDOMStorageAgent::restore() |
87 { | 86 { |
88 if (m_state->getBoolean(DOMStorageAgentState::domStorageAgentEnabled)) | 87 if (m_state->booleanProperty(DOMStorageAgentState::domStorageAgentEnabled, f
alse)) |
89 enable(0); | 88 enable(0); |
90 } | 89 } |
91 | 90 |
92 void InspectorDOMStorageAgent::enable(ErrorString*) | 91 void InspectorDOMStorageAgent::enable(ErrorString*) |
93 { | 92 { |
94 if (m_isEnabled) | 93 if (m_isEnabled) |
95 return; | 94 return; |
96 m_isEnabled = true; | 95 m_isEnabled = true; |
97 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, true); | 96 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, true); |
98 if (StorageNamespaceController* controller = StorageNamespaceController::fro
m(m_page)) | 97 if (StorageNamespaceController* controller = StorageNamespaceController::fro
m(m_page)) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 StorageNamespace* sessionStorage = StorageNamespaceController::from(m_page)-
>sessionStorage(); | 222 StorageNamespace* sessionStorage = StorageNamespaceController::from(m_page)-
>sessionStorage(); |
224 if (!sessionStorage) { | 223 if (!sessionStorage) { |
225 if (errorString) | 224 if (errorString) |
226 *errorString = "SessionStorage is not supported"; | 225 *errorString = "SessionStorage is not supported"; |
227 return nullptr; | 226 return nullptr; |
228 } | 227 } |
229 return sessionStorage->storageArea(frame->document()->securityOrigin()); | 228 return sessionStorage->storageArea(frame->document()->securityOrigin()); |
230 } | 229 } |
231 | 230 |
232 } // namespace blink | 231 } // namespace blink |
OLD | NEW |