| 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 "content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h
" | 5 #include "content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h
" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 10 #include "content/browser/in_process_webkit/indexed_db_key_utility_client.h" | 10 #include "content/browser/in_process_webkit/indexed_db_key_utility_client.h" |
| 11 #include "content/common/indexed_db/indexed_db_key.h" | 11 #include "content/common/indexed_db/indexed_db_key.h" |
| 12 #include "content/common/indexed_db/indexed_db_key_path.h" | 12 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 13 #include "content/public/common/serialized_script_value.h" | 13 #include "content/public/common/serialized_script_value.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 18 #include "webkit/glue/webkit_glue.h" | 18 #include "webkit/glue/webkit_glue.h" |
| 19 | 19 |
| 20 using content::IndexedDBKey; |
| 21 using content::IndexedDBKeyPath; |
| 22 using content::SerializedScriptValue; |
| 23 |
| 20 BrowserWebKitPlatformSupportImpl::BrowserWebKitPlatformSupportImpl() { | 24 BrowserWebKitPlatformSupportImpl::BrowserWebKitPlatformSupportImpl() { |
| 21 file_utilities_.set_sandbox_enabled(false); | 25 file_utilities_.set_sandbox_enabled(false); |
| 22 } | 26 } |
| 23 | 27 |
| 24 BrowserWebKitPlatformSupportImpl::~BrowserWebKitPlatformSupportImpl() { | 28 BrowserWebKitPlatformSupportImpl::~BrowserWebKitPlatformSupportImpl() { |
| 25 } | 29 } |
| 26 | 30 |
| 27 WebKit::WebClipboard* BrowserWebKitPlatformSupportImpl::clipboard() { | 31 WebKit::WebClipboard* BrowserWebKitPlatformSupportImpl::clipboard() { |
| 28 NOTREACHED(); | 32 NOTREACHED(); |
| 29 return NULL; | 33 return NULL; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); | 131 const FilePath path = webkit_glue::WebStringToFilePath(vfs_file_name); |
| 128 return file_util::Delete(path, false) ? 0 : 1; | 132 return file_util::Delete(path, false) ? 0 : 1; |
| 129 } | 133 } |
| 130 | 134 |
| 131 void | 135 void |
| 132 BrowserWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath( | 136 BrowserWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyPath( |
| 133 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, | 137 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, |
| 134 const WebKit::WebIDBKeyPath& keyPath, | 138 const WebKit::WebIDBKeyPath& keyPath, |
| 135 WebKit::WebVector<WebKit::WebIDBKey>& keys) { | 139 WebKit::WebVector<WebKit::WebIDBKey>& keys) { |
| 136 | 140 |
| 137 std::vector<content::SerializedScriptValue> std_values; | 141 std::vector<SerializedScriptValue> std_values; |
| 138 size_t size = values.size(); | 142 size_t size = values.size(); |
| 139 std_values.reserve(size); | 143 std_values.reserve(size); |
| 140 for (size_t i = 0; i < size; ++i) | 144 for (size_t i = 0; i < size; ++i) |
| 141 std_values.push_back(content::SerializedScriptValue(values[i])); | 145 std_values.push_back(SerializedScriptValue(values[i])); |
| 142 | 146 |
| 143 std::vector<IndexedDBKey> std_keys; | 147 std::vector<IndexedDBKey> std_keys; |
| 144 IndexedDBKeyUtilityClient:: | 148 IndexedDBKeyUtilityClient:: |
| 145 CreateIDBKeysFromSerializedValuesAndKeyPath( | 149 CreateIDBKeysFromSerializedValuesAndKeyPath( |
| 146 std_values, content::IndexedDBKeyPath(keyPath), &std_keys); | 150 std_values, IndexedDBKeyPath(keyPath), &std_keys); |
| 147 | 151 |
| 148 keys = std_keys; | 152 keys = std_keys; |
| 149 } | 153 } |
| 150 | 154 |
| 151 WebKit::WebSerializedScriptValue | 155 WebKit::WebSerializedScriptValue |
| 152 BrowserWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( | 156 BrowserWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( |
| 153 const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value, | 157 const WebKit::WebIDBKey& key, const WebKit::WebSerializedScriptValue& value, |
| 154 const WebKit::WebIDBKeyPath& keyPath) { | 158 const WebKit::WebIDBKeyPath& keyPath) { |
| 155 return IndexedDBKeyUtilityClient::InjectIDBKeyIntoSerializedValue( | 159 return IndexedDBKeyUtilityClient::InjectIDBKeyIntoSerializedValue( |
| 156 IndexedDBKey(key), content::SerializedScriptValue(value), | 160 IndexedDBKey(key), SerializedScriptValue(value), |
| 157 content::IndexedDBKeyPath(keyPath)); | 161 IndexedDBKeyPath(keyPath)); |
| 158 } | 162 } |
| 159 | 163 |
| 160 GpuChannelHostFactory* | 164 GpuChannelHostFactory* |
| 161 BrowserWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 165 BrowserWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
| 162 return content::BrowserGpuChannelHostFactory::instance(); | 166 return content::BrowserGpuChannelHostFactory::instance(); |
| 163 } | 167 } |
| OLD | NEW |