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

Unified Diff: ios/web/webui/url_data_source_ios_impl.cc

Issue 1110213002: Upstream most of the iOS WebUI support in ios/web/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/webui/url_data_source_ios_impl.cc
diff --git a/content/browser/webui/url_data_source_impl.cc b/ios/web/webui/url_data_source_ios_impl.cc
similarity index 53%
copy from content/browser/webui/url_data_source_impl.cc
copy to ios/web/webui/url_data_source_ios_impl.cc
index 10b88ec7d452c2f0f036ddfd8b47e085622d9a51..239847e7d50a98a12917227f6afc39c868164631 100644
--- a/content/browser/webui/url_data_source_impl.cc
+++ b/ios/web/webui/url_data_source_ios_impl.cc
@@ -1,34 +1,32 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/webui/url_data_source_impl.h"
+#include "ios/web/webui/url_data_source_ios_impl.h"
#include "base/bind.h"
+#include "base/location.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.h"
-#include "content/browser/webui/url_data_manager_backend.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/url_data_source.h"
+#include "ios/web/public/url_data_source_ios.h"
+#include "ios/web/public/web_thread.h"
+#include "ios/web/webui/url_data_manager_ios_backend.h"
-namespace content {
+namespace web {
-URLDataSourceImpl::URLDataSourceImpl(const std::string& source_name,
- URLDataSource* source)
- : source_name_(source_name),
- backend_(NULL),
- source_(source) {
+URLDataSourceIOSImpl::URLDataSourceIOSImpl(const std::string& source_name,
+ URLDataSourceIOS* source)
+ : source_name_(source_name), backend_(NULL), source_(source) {
}
-URLDataSourceImpl::~URLDataSourceImpl() {
+URLDataSourceIOSImpl::~URLDataSourceIOSImpl() {
}
-void URLDataSourceImpl::SendResponse(
- int request_id,
- base::RefCountedMemory* bytes) {
+void URLDataSourceIOSImpl::SendResponse(int request_id,
+ base::RefCountedMemory* bytes) {
// Take a ref-pointer on entry so byte->Release() will always get called.
scoped_refptr<base::RefCountedMemory> bytes_ptr(bytes);
- if (URLDataManager::IsScheduledForDeletion(this)) {
+ if (URLDataManagerIOS::IsScheduledForDeletion(this)) {
// We're scheduled for deletion. Servicing the request would result in
// this->AddRef being invoked, even though the ref count is 0 and 'this' is
// about to be deleted. If the AddRef were allowed through, when 'this' is
@@ -42,18 +40,18 @@ void URLDataSourceImpl::SendResponse(
// when the object is deleted.
return;
}
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&URLDataSourceImpl::SendResponseOnIOThread, this, request_id,
- bytes_ptr));
+ web::WebThread::PostTask(
+ web::WebThread::IO, FROM_HERE,
+ base::Bind(&URLDataSourceIOSImpl::SendResponseOnIOThread, this,
+ request_id, bytes_ptr));
}
-void URLDataSourceImpl::SendResponseOnIOThread(
+void URLDataSourceIOSImpl::SendResponseOnIOThread(
int request_id,
scoped_refptr<base::RefCountedMemory> bytes) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO);
if (backend_)
backend_->DataAvailable(request_id, bytes.get());
}
-} // namespace content
+} // namespace web

Powered by Google App Engine
This is Rietveld 408576698