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

Unified Diff: ios/web/webui/url_data_manager_ios_backend.h

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_manager_ios_backend.h
diff --git a/content/browser/webui/url_data_manager_backend.h b/ios/web/webui/url_data_manager_ios_backend.h
similarity index 52%
copy from content/browser/webui/url_data_manager_backend.h
copy to ios/web/webui/url_data_manager_ios_backend.h
index e0af605e8a73db6c31fb46d89e16d69f5c845f26..d5052380c1875a1749b7d2893b21b1f163ad9a17 100644
--- a/content/browser/webui/url_data_manager_backend.h
+++ b/ios/web/webui/url_data_manager_ios_backend.h
@@ -1,9 +1,9 @@
-// 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.
-#ifndef CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_
-#define CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_
+#ifndef IOS_INTERNAL_WEB_WEBUI_URL_DATA_MANAGER_BACKEND_IOS_H_
+#define IOS_INTERNAL_WEB_WEBUI_URL_DATA_MANAGER_BACKEND_IOS_H_
#include <map>
#include <string>
@@ -12,8 +12,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/supports_user_data.h"
-#include "content/browser/webui/url_data_manager.h"
-#include "content/public/browser/url_data_source.h"
+#include "ios/web/public/url_data_source_ios.h"
+#include "ios/web/webui/url_data_manager_ios.h"
#include "net/url_request/url_request_job_factory.h"
class GURL;
@@ -22,35 +22,28 @@ namespace base {
class RefCountedMemory;
}
-namespace content {
-
-class AppCacheServiceImpl;
-class ChromeBlobStorageContext;
-class ResourceContext;
-class URLDataManagerBackend;
-class URLDataSourceImpl;
+namespace web {
+class BrowserState;
+class URLDataSourceIOSImpl;
class URLRequestChromeJob;
-// URLDataManagerBackend is used internally by ChromeURLDataManager on the IO
-// thread. In most cases you can use the API in ChromeURLDataManager and ignore
-// this class. URLDataManagerBackend is owned by ResourceContext.
-class URLDataManagerBackend : public base::SupportsUserData::Data {
+// URLDataManagerIOSBackend is used internally by URLDataManagerIOS on
+// the IO thread. In most cases you can use the API in URLDataManagerIOS
+// and ignore this class. URLDataManagerIOSBackend is owned by BrowserState.
+class URLDataManagerIOSBackend : public base::SupportsUserData::Data {
public:
typedef int RequestID;
- URLDataManagerBackend();
- ~URLDataManagerBackend() override;
+ URLDataManagerIOSBackend();
+ ~URLDataManagerIOSBackend() override;
// Invoked to create the protocol handler for chrome://. |is_incognito| should
- // be set for incognito profiles. Called on the UI thread.
- CONTENT_EXPORT static net::URLRequestJobFactory::ProtocolHandler*
- CreateProtocolHandler(content::ResourceContext* resource_context,
- bool is_incognito,
- AppCacheServiceImpl* appcache_service,
- ChromeBlobStorageContext* blob_storage_context);
+ // be set for incognito browser states. Called on the UI thread.
+ static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler(
+ BrowserState* browser_state);
// Adds a DataSource to the collection of data sources.
- void AddDataSource(URLDataSourceImpl* source);
+ void AddDataSource(URLDataSourceIOSImpl* source);
// DataSource invokes this. Sends the data to the URLRequest.
void DataAvailable(RequestID request_id, base::RefCountedMemory* bytes);
@@ -61,8 +54,8 @@ class URLDataManagerBackend : public base::SupportsUserData::Data {
private:
friend class URLRequestChromeJob;
- typedef std::map<std::string,
- scoped_refptr<URLDataSourceImpl> > DataSourceMap;
+ typedef std::map<std::string, scoped_refptr<URLDataSourceIOSImpl> >
+ DataSourceMap;
typedef std::map<RequestID, URLRequestChromeJob*> PendingRequestMap;
// Called by the job when it's starting up.
@@ -70,12 +63,10 @@ class URLDataManagerBackend : public base::SupportsUserData::Data {
bool StartRequest(const net::URLRequest* request, URLRequestChromeJob* job);
// Helper function to call StartDataRequest on |source|'s delegate. This is
- // needed because while we want to call URLDataSourceDelegate's method, we
+ // needed because while we want to call URLDataSourceIOSDelegate's method, we
// need to add a refcount on the source.
- static void CallStartRequest(scoped_refptr<URLDataSourceImpl> source,
+ static void CallStartRequest(scoped_refptr<URLDataSourceIOSImpl> source,
const std::string& path,
- int render_process_id,
- int render_frame_id,
int request_id);
// Remove a request from the list of pending requests.
@@ -88,7 +79,7 @@ class URLDataManagerBackend : public base::SupportsUserData::Data {
// Look up the data source for the request. Returns the source if it is found,
// else NULL.
- URLDataSourceImpl* GetDataSourceFromURL(const GURL& url);
+ URLDataSourceIOSImpl* GetDataSourceFromURL(const GURL& url);
// Custom sources of data, keyed by source path (e.g. "favicon").
DataSourceMap data_sources_;
@@ -101,15 +92,9 @@ class URLDataManagerBackend : public base::SupportsUserData::Data {
// The ID we'll use for the next request we receive.
RequestID next_request_id_;
- DISALLOW_COPY_AND_ASSIGN(URLDataManagerBackend);
+ DISALLOW_COPY_AND_ASSIGN(URLDataManagerIOSBackend);
};
-// Creates protocol handler for chrome-devtools://. |is_incognito| should be
-// set for incognito profiles.
-net::URLRequestJobFactory::ProtocolHandler*
-CreateDevToolsProtocolHandler(content::ResourceContext* resource_context,
- bool is_incognito);
-
-} // namespace content
+} // namespace web
-#endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_BACKEND_H_
+#endif // IOS_INTERNAL_WEB_WEBUI_URL_DATA_MANAGER_BACKEND_IOS_H_

Powered by Google App Engine
This is Rietveld 408576698