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

Unified Diff: content/browser/android/content_protocol_handler_impl.cc

Issue 739033003: Support content scheme uri for Chrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 1 month 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: content/browser/android/content_protocol_handler_impl.cc
diff --git a/content/browser/android/content_protocol_handler_impl.cc b/content/browser/android/content_protocol_handler_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f5e5d208f8f55f0913b95aed48bb4b277675463c
--- /dev/null
+++ b/content/browser/android/content_protocol_handler_impl.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 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/android/content_protocol_handler_impl.h"
+
+#include "base/task_runner.h"
+#include "content/browser/android/url_request_content_job.h"
+#include "net/base/net_errors.h"
+#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_error_job.h"
+
+namespace content {
+
+// static
+ContentProtocolHandler* ContentProtocolHandler::Create(
+ const scoped_refptr<base::TaskRunner>& content_task_runner) {
+ return new ContentProtocolHandlerImpl(content_task_runner);
+}
+
+ContentProtocolHandlerImpl::ContentProtocolHandlerImpl(
+ const scoped_refptr<base::TaskRunner>& content_task_runner)
+ : content_task_runner_(content_task_runner) {}
+
+ContentProtocolHandlerImpl::~ContentProtocolHandlerImpl() {}
+
+net::URLRequestJob* ContentProtocolHandlerImpl::MaybeCreateJob(
+ net::URLRequest* request, net::NetworkDelegate* network_delegate) const {
+ if (!network_delegate) {
+ return new net::URLRequestErrorJob(
+ request, network_delegate, net::ERR_ACCESS_DENIED);
+ }
+ return new URLRequestContentJob(
+ request, network_delegate, base::FilePath(request->url().spec()),
+ content_task_runner_);
+}
+
+bool ContentProtocolHandlerImpl::IsSafeRedirectTarget(
+ const GURL& location) const {
+ return false;
+}
+
+} // namespace content
« no previous file with comments | « content/browser/android/content_protocol_handler_impl.h ('k') | content/browser/android/url_request_content_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698