OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/indexed_db/indexed_db_internals_ui.h" | 5 #include "content/browser/indexed_db/indexed_db_internals_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 base::Bind(&IndexedDBInternalsUI::AddContextFromStoragePartition, | 97 base::Bind(&IndexedDBInternalsUI::AddContextFromStoragePartition, |
98 base::Unretained(this)); | 98 base::Unretained(this)); |
99 BrowserContext::ForEachStoragePartition(browser_context, cb); | 99 BrowserContext::ForEachStoragePartition(browser_context, cb); |
100 } | 100 } |
101 | 101 |
102 void IndexedDBInternalsUI::GetAllOriginsOnIndexedDBThread( | 102 void IndexedDBInternalsUI::GetAllOriginsOnIndexedDBThread( |
103 scoped_refptr<IndexedDBContext> context, | 103 scoped_refptr<IndexedDBContext> context, |
104 const base::FilePath& context_path) { | 104 const base::FilePath& context_path) { |
105 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); | 105 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); |
106 | 106 |
| 107 #if 0 |
107 IndexedDBContextImpl* context_impl = | 108 IndexedDBContextImpl* context_impl = |
108 static_cast<IndexedDBContextImpl*>(context.get()); | 109 static_cast<IndexedDBContextImpl*>(context.get()); |
109 | 110 |
| 111 // TODO(cmumford): Convert this call to Mojo. |
110 std::unique_ptr<base::ListValue> info_list( | 112 std::unique_ptr<base::ListValue> info_list( |
111 context_impl->GetAllOriginsDetails()); | 113 context_impl->GetAllOriginsDetails()); |
112 bool is_incognito = context_impl->is_incognito(); | 114 bool is_incognito = context_impl->is_incognito(); |
113 | 115 |
114 BrowserThread::PostTask( | 116 BrowserThread::PostTask( |
115 BrowserThread::UI, | 117 BrowserThread::UI, |
116 FROM_HERE, | 118 FROM_HERE, |
117 base::Bind(&IndexedDBInternalsUI::OnOriginsReady, | 119 base::Bind(&IndexedDBInternalsUI::OnOriginsReady, |
118 base::Unretained(this), | 120 base::Unretained(this), |
119 base::Passed(&info_list), | 121 base::Passed(&info_list), |
120 is_incognito ? base::FilePath() : context_path)); | 122 is_incognito ? base::FilePath() : context_path)); |
| 123 #endif |
121 } | 124 } |
122 | 125 |
123 void IndexedDBInternalsUI::OnOriginsReady( | 126 void IndexedDBInternalsUI::OnOriginsReady( |
124 std::unique_ptr<base::ListValue> origins, | 127 std::unique_ptr<base::ListValue> origins, |
125 const base::FilePath& path) { | 128 const base::FilePath& path) { |
126 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 129 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
127 web_ui()->CallJavascriptFunctionUnsafe("indexeddb.onOriginsReady", *origins, | 130 web_ui()->CallJavascriptFunctionUnsafe("indexeddb.onOriginsReady", *origins, |
128 base::StringValue(path.value())); | 131 base::StringValue(path.value())); |
129 } | 132 } |
130 | 133 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 361 |
359 item->AddObserver(new FileDeleter(temp_path)); | 362 item->AddObserver(new FileDeleter(temp_path)); |
360 web_ui()->CallJavascriptFunctionUnsafe( | 363 web_ui()->CallJavascriptFunctionUnsafe( |
361 "indexeddb.onOriginDownloadReady", | 364 "indexeddb.onOriginDownloadReady", |
362 base::StringValue(partition_path.value()), | 365 base::StringValue(partition_path.value()), |
363 base::StringValue(origin.Serialize()), | 366 base::StringValue(origin.Serialize()), |
364 base::FundamentalValue(static_cast<double>(connection_count))); | 367 base::FundamentalValue(static_cast<double>(connection_count))); |
365 } | 368 } |
366 | 369 |
367 } // namespace content | 370 } // namespace content |
OLD | NEW |