| Index: android_webview/browser/aw_contents_io_thread_client_impl.cc
|
| diff --git a/android_webview/native/aw_contents_io_thread_client_impl.cc b/android_webview/browser/aw_contents_io_thread_client_impl.cc
|
| similarity index 94%
|
| rename from android_webview/native/aw_contents_io_thread_client_impl.cc
|
| rename to android_webview/browser/aw_contents_io_thread_client_impl.cc
|
| index 855cc860611ffd229a1953953049d595a9614cc5..c85a803491a4826cfd76bcd7c4cabc909825f28b 100644
|
| --- a/android_webview/native/aw_contents_io_thread_client_impl.cc
|
| +++ b/android_webview/browser/aw_contents_io_thread_client_impl.cc
|
| @@ -2,16 +2,16 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "android_webview/native/aw_contents_io_thread_client_impl.h"
|
| +#include "android_webview/browser/aw_contents_io_thread_client_impl.h"
|
|
|
| #include <map>
|
| #include <memory>
|
| #include <utility>
|
|
|
| +#include "android_webview/browser/aw_contents_background_thread_client.h"
|
| +#include "android_webview/browser/aw_web_resource_response_impl.h"
|
| #include "android_webview/browser/net/aw_web_resource_request.h"
|
| #include "android_webview/common/devtools_instrumentation.h"
|
| -#include "android_webview/native/aw_contents_background_thread_client.h"
|
| -#include "android_webview/native/aw_web_resource_response_impl.h"
|
| #include "base/android/jni_array.h"
|
| #include "base/android/jni_string.h"
|
| #include "base/android/jni_weak_ref.h"
|
| @@ -103,8 +103,8 @@ void RfhToIoThreadClientMap::Set(pair<int, int> rfh_id,
|
| rfh_to_io_thread_client_[rfh_id] = client;
|
| }
|
|
|
| -bool RfhToIoThreadClientMap::Get(
|
| - pair<int, int> rfh_id, IoThreadClientData* client) {
|
| +bool RfhToIoThreadClientMap::Get(pair<int, int> rfh_id,
|
| + IoThreadClientData* client) {
|
| base::AutoLock lock(map_lock_);
|
| RenderFrameHostToIoThreadClientType::iterator iterator =
|
| rfh_to_io_thread_client_.find(rfh_id);
|
| @@ -147,7 +147,8 @@ void RfhToIoThreadClientMap::Erase(int frame_tree_node_id) {
|
|
|
| class ClientMapEntryUpdater : public content::WebContentsObserver {
|
| public:
|
| - ClientMapEntryUpdater(JNIEnv* env, WebContents* web_contents,
|
| + ClientMapEntryUpdater(JNIEnv* env,
|
| + WebContents* web_contents,
|
| jobject jdelegate);
|
|
|
| void RenderFrameCreated(RenderFrameHost* render_frame_host) override;
|
| @@ -161,8 +162,7 @@ class ClientMapEntryUpdater : public content::WebContentsObserver {
|
| ClientMapEntryUpdater::ClientMapEntryUpdater(JNIEnv* env,
|
| WebContents* web_contents,
|
| jobject jdelegate)
|
| - : content::WebContentsObserver(web_contents),
|
| - jdelegate_(env, jdelegate) {
|
| + : content::WebContentsObserver(web_contents), jdelegate_(env, jdelegate) {
|
| DCHECK(web_contents);
|
| DCHECK(jdelegate);
|
|
|
| @@ -189,7 +189,7 @@ void ClientMapEntryUpdater::WebContentsDestroyed() {
|
| delete this;
|
| }
|
|
|
| -} // namespace
|
| +} // namespace
|
|
|
| // AwContentsIoThreadClientImpl -----------------------------------------------
|
|
|
| @@ -253,9 +253,8 @@ void AwContentsIoThreadClientImpl::RegisterPendingContents(
|
| }
|
|
|
| // static
|
| -void AwContentsIoThreadClientImpl::Associate(
|
| - WebContents* web_contents,
|
| - const JavaRef<jobject>& jclient) {
|
| +void AwContentsIoThreadClientImpl::Associate(WebContents* web_contents,
|
| + const JavaRef<jobject>& jclient) {
|
| JNIEnv* env = AttachCurrentThread();
|
| // The ClientMapEntryUpdater lifespan is tied to the WebContents.
|
| new ClientMapEntryUpdater(env, web_contents, jclient.obj());
|
| @@ -288,9 +287,7 @@ AwContentsIoThreadClient::GetServiceWorkerIoThreadClient() {
|
| AwContentsIoThreadClientImpl::AwContentsIoThreadClientImpl(
|
| bool pending_association,
|
| const JavaRef<jobject>& obj)
|
| - : pending_association_(pending_association),
|
| - java_object_(obj) {
|
| -}
|
| + : pending_association_(pending_association), java_object_(obj) {}
|
|
|
| AwContentsIoThreadClientImpl::~AwContentsIoThreadClientImpl() {
|
| // explict, out-of-line destructor.
|
| @@ -300,8 +297,8 @@ bool AwContentsIoThreadClientImpl::PendingAssociation() const {
|
| return pending_association_;
|
| }
|
|
|
| -AwContentsIoThreadClient::CacheMode
|
| -AwContentsIoThreadClientImpl::GetCacheMode() const {
|
| +AwContentsIoThreadClient::CacheMode AwContentsIoThreadClientImpl::GetCacheMode()
|
| + const {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| if (java_object_.is_null())
|
| return AwContentsIoThreadClient::LOAD_DEFAULT;
|
| @@ -311,7 +308,6 @@ AwContentsIoThreadClientImpl::GetCacheMode() const {
|
| Java_AwContentsIoThreadClient_getCacheMode(env, java_object_));
|
| }
|
|
|
| -
|
| namespace {
|
|
|
| std::unique_ptr<AwWebResourceResponse> RunShouldInterceptRequest(
|
| @@ -414,4 +410,4 @@ bool AwContentsIoThreadClientImpl::ShouldBlockNetworkLoads() const {
|
| java_object_);
|
| }
|
|
|
| -} // namespace android_webview
|
| +} // namespace android_webview
|
|
|