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

Unified Diff: android_webview/browser/intercepted_request_data.cc

Issue 284123004: [android_webview] Add more params to request intercepting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix accidentally broken test Created 6 years, 6 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: android_webview/browser/intercepted_request_data.cc
diff --git a/android_webview/browser/intercepted_request_data.cc b/android_webview/browser/intercepted_request_data.cc
deleted file mode 100644
index 6e25ce14474fbff9d4389581e6de9c0d21251abf..0000000000000000000000000000000000000000
--- a/android_webview/browser/intercepted_request_data.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2013 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 "android_webview/browser/intercepted_request_data.h"
-
-#include "android_webview/browser/input_stream.h"
-#include "android_webview/browser/net/android_stream_reader_url_request_job.h"
-
-namespace android_webview {
-
-namespace {
-
-class StreamReaderJobDelegateImpl
- : public AndroidStreamReaderURLRequestJob::Delegate {
- public:
- StreamReaderJobDelegateImpl(
- scoped_ptr<InterceptedRequestData> intercepted_request_data)
- : intercepted_request_data_(intercepted_request_data.Pass()) {
- DCHECK(intercepted_request_data_);
- }
-
- virtual scoped_ptr<InputStream> OpenInputStream(JNIEnv* env,
- const GURL& url) OVERRIDE {
- return intercepted_request_data_->GetInputStream(env).Pass();
- }
-
- virtual void OnInputStreamOpenFailed(net::URLRequest* request,
- bool* restart) OVERRIDE {
- *restart = false;
- }
-
- virtual bool GetMimeType(JNIEnv* env,
- net::URLRequest* request,
- android_webview::InputStream* stream,
- std::string* mime_type) OVERRIDE {
- return intercepted_request_data_->GetMimeType(env, mime_type);
- }
-
- virtual bool GetCharset(JNIEnv* env,
- net::URLRequest* request,
- android_webview::InputStream* stream,
- std::string* charset) OVERRIDE {
- return intercepted_request_data_->GetCharset(env, charset);
- }
-
- private:
- scoped_ptr<InterceptedRequestData> intercepted_request_data_;
-};
-
-} // namespace
-
-// static
-net::URLRequestJob* InterceptedRequestData::CreateJobFor(
- scoped_ptr<InterceptedRequestData> intercepted_request_data,
- net::URLRequest* request,
- net::NetworkDelegate* network_delegate) {
- DCHECK(intercepted_request_data);
- DCHECK(request);
- DCHECK(network_delegate);
-
- return new AndroidStreamReaderURLRequestJob(
- request,
- network_delegate,
- make_scoped_ptr(
- new StreamReaderJobDelegateImpl(intercepted_request_data.Pass()))
- .PassAs<AndroidStreamReaderURLRequestJob::Delegate>());
-}
-
-} // namespace android_webview

Powered by Google App Engine
This is Rietveld 408576698