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/test_shell_webblobregistry_impl.h" | 5 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "third_party/WebKit/public/platform/WebBlobData.h" | 10 #include "third_party/WebKit/public/platform/WebBlobData.h" |
11 #include "third_party/WebKit/public/platform/WebURL.h" | 11 #include "third_party/WebKit/public/platform/WebURL.h" |
12 #include "webkit/base/file_path_string_conversions.h" | 12 #include "webkit/base/file_path_string_conversions.h" |
13 #include "webkit/browser/blob/blob_storage_controller.h" | 13 #include "webkit/browser/blob/blob_storage_controller.h" |
14 #include "webkit/common/blob/blob_data.h" | 14 #include "webkit/common/blob/blob_data.h" |
15 | 15 |
16 using WebKit::WebBlobData; | 16 using WebKit::WebBlobData; |
17 using WebKit::WebURL; | 17 using WebKit::WebURL; |
18 using webkit_blob::BlobData; | 18 using webkit_blob::BlobData; |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 MessageLoop* g_io_thread; | 22 base::MessageLoop* g_io_thread; |
23 webkit_blob::BlobStorageController* g_blob_storage_controller; | 23 webkit_blob::BlobStorageController* g_blob_storage_controller; |
24 | 24 |
25 // Creates a new BlobData from WebBlobData. | 25 // Creates a new BlobData from WebBlobData. |
26 BlobData* NewBlobData(const WebBlobData& data) { | 26 BlobData* NewBlobData(const WebBlobData& data) { |
27 BlobData* blob = new BlobData; | 27 BlobData* blob = new BlobData; |
28 size_t i = 0; | 28 size_t i = 0; |
29 WebBlobData::Item item; | 29 WebBlobData::Item item; |
30 while (data.itemAt(i++, item)) { | 30 while (data.itemAt(i++, item)) { |
31 switch (item.type) { | 31 switch (item.type) { |
32 case WebBlobData::Item::TypeData: | 32 case WebBlobData::Item::TypeData: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 void TestShellWebBlobRegistryImpl::CloneBlob( | 115 void TestShellWebBlobRegistryImpl::CloneBlob( |
116 const GURL& url, const GURL& src_url) { | 116 const GURL& url, const GURL& src_url) { |
117 DCHECK(g_blob_storage_controller); | 117 DCHECK(g_blob_storage_controller); |
118 g_blob_storage_controller->CloneBlob(url, src_url); | 118 g_blob_storage_controller->CloneBlob(url, src_url); |
119 } | 119 } |
120 | 120 |
121 void TestShellWebBlobRegistryImpl::RemoveBlob(const GURL& url) { | 121 void TestShellWebBlobRegistryImpl::RemoveBlob(const GURL& url) { |
122 DCHECK(g_blob_storage_controller); | 122 DCHECK(g_blob_storage_controller); |
123 g_blob_storage_controller->RemoveBlob(url); | 123 g_blob_storage_controller->RemoveBlob(url); |
124 } | 124 } |
OLD | NEW |