0

[Android WebView] Put AndroidStreamReaderURLRequestJob into a namespace

Put the class into android_webview ns, just like any other.

Review URL: https://codereview.chromium.org/1356213003

Cr-Commit-Position: refs/heads/master@{#350055}
This commit is contained in:
mnaganov
2015-09-21 15:54:29 -07:00
committed by Commit bot
parent 64c1f0b9a4
commit 2cd9d01be2
4 changed files with 23 additions and 12 deletions

@ -29,12 +29,12 @@
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job_manager.h"
using android_webview::InputStream;
using android_webview::InputStreamReader;
using base::android::AttachCurrentThread;
using base::PostTaskAndReplyWithResult;
using content::BrowserThread;
namespace android_webview {
namespace {
const int kHTTPOk = 200;
@ -63,7 +63,7 @@ class InputStreamReaderWrapper :
DCHECK(input_stream_reader_);
}
android_webview::InputStream* input_stream() {
InputStream* input_stream() {
return input_stream_.get();
}
@ -79,8 +79,8 @@ class InputStreamReaderWrapper :
friend class base::RefCountedThreadSafe<InputStreamReaderWrapper>;
~InputStreamReaderWrapper() {}
scoped_ptr<android_webview::InputStream> input_stream_;
scoped_ptr<android_webview::InputStreamReader> input_stream_reader_;
scoped_ptr<InputStream> input_stream_;
scoped_ptr<InputStreamReader> input_stream_reader_;
DISALLOW_COPY_AND_ASSIGN(InputStreamReaderWrapper);
};
@ -365,3 +365,5 @@ void AndroidStreamReaderURLRequestJob::SetExtraRequestHeaders(
}
}
}
} // namespace android_webview

@ -16,11 +16,6 @@
#include "net/http/http_byte_range.h"
#include "net/url_request/url_request_job.h"
namespace android_webview {
class InputStream;
class InputStreamReader;
}
namespace base {
class TaskRunner;
}
@ -31,6 +26,10 @@ class HttpResponseInfo;
class URLRequest;
}
namespace android_webview {
class InputStream;
class InputStreamReader;
class InputStreamReaderWrapper;
// A request job that reads data from a Java InputStream.
@ -120,4 +119,6 @@ class AndroidStreamReaderURLRequestJob : public net::URLRequestJob {
DISALLOW_COPY_AND_ASSIGN(AndroidStreamReaderURLRequestJob);
};
} // namespace android_webview
#endif // ANDROID_WEBVIEW_NATIVE_ANDROID_STREAM_READER_URL_REQUEST_JOB_H_

@ -22,8 +22,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using android_webview::InputStream;
using android_webview::InputStreamReader;
using net::TestDelegate;
using net::TestJobInterceptor;
using net::TestNetworkDelegate;
@ -45,6 +43,10 @@ using testing::WithArg;
using testing::WithArgs;
using testing::_;
namespace android_webview {
namespace {
// Some of the classes will DCHECK on a null InputStream (which is desirable).
// The workaround is to use this class. None of the methods need to be
// implemented as the mock InputStreamReader should never forward calls to the
@ -179,6 +181,9 @@ class TestStreamReaderJob : public AndroidStreamReaderURLRequestJob {
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
};
} // namespace
class AndroidStreamReaderURLRequestJobTest : public Test {
public:
AndroidStreamReaderURLRequestJobTest() {}
@ -415,3 +420,5 @@ TEST_F(AndroidStreamReaderURLRequestJobTest, DeleteJobMidWayRead) {
req_->Cancel();
EXPECT_EQ(1, network_delegate_.completed_requests());
}
} // namespace android_webview

@ -23,6 +23,7 @@
#include "url/gurl.h"
#include "url/url_constants.h"
using android_webview::AndroidStreamReaderURLRequestJob;
using android_webview::InputStream;
using android_webview::InputStreamImpl;
using base::android::AttachCurrentThread;