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

Side by Side Diff: android_webview/browser/aw_contents_io_thread_client.h

Issue 1350553005: [Android WebView] Call shouldInterceptRequest on a background thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Get rid of has_been_killed Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 12
12 class GURL; 13 class GURL;
13 14
14 namespace net { 15 namespace net {
15 class HttpResponseHeaders; 16 class HttpResponseHeaders;
16 class URLRequest; 17 class URLRequest;
17 } 18 }
18 19
19 namespace android_webview { 20 namespace android_webview {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // An empty scoped_ptr is a valid return value. 63 // An empty scoped_ptr is a valid return value.
63 static scoped_ptr<AwContentsIoThreadClient> FromID(int render_process_id, 64 static scoped_ptr<AwContentsIoThreadClient> FromID(int render_process_id,
64 int render_frame_id); 65 int render_frame_id);
65 66
66 // Called on the IO thread when a subframe is created. 67 // Called on the IO thread when a subframe is created.
67 static void SubFrameCreated(int render_process_id, 68 static void SubFrameCreated(int render_process_id,
68 int parent_render_frame_id, 69 int parent_render_frame_id,
69 int child_render_frame_id); 70 int child_render_frame_id);
70 71
71 // This method is called on the IO thread only. 72 // This method is called on the IO thread only.
72 virtual scoped_ptr<AwWebResourceResponse> ShouldInterceptRequest( 73 typedef base::Callback<void(scoped_ptr<AwWebResourceResponse>)>
73 const net::URLRequest* request) = 0; 74 ShouldInterceptRequestResultCallback;
75 virtual void ShouldInterceptRequestAsync(
76 const net::URLRequest* request,
77 const ShouldInterceptRequestResultCallback callback) = 0;
74 78
75 // Retrieve the AllowContentAccess setting value of this AwContents. 79 // Retrieve the AllowContentAccess setting value of this AwContents.
76 // This method is called on the IO thread only. 80 // This method is called on the IO thread only.
77 virtual bool ShouldBlockContentUrls() const = 0; 81 virtual bool ShouldBlockContentUrls() const = 0;
78 82
79 // Retrieve the AllowFileAccess setting value of this AwContents. 83 // Retrieve the AllowFileAccess setting value of this AwContents.
80 // This method is called on the IO thread only. 84 // This method is called on the IO thread only.
81 virtual bool ShouldBlockFileUrls() const = 0; 85 virtual bool ShouldBlockFileUrls() const = 0;
82 86
83 // Retrieve the BlockNetworkLoads setting value of this AwContents. 87 // Retrieve the BlockNetworkLoads setting value of this AwContents.
(...skipping 25 matching lines...) Expand all
109 113
110 // Called when a response from the server is received with status code >= 400. 114 // Called when a response from the server is received with status code >= 400.
111 virtual void OnReceivedHttpError( 115 virtual void OnReceivedHttpError(
112 const net::URLRequest* request, 116 const net::URLRequest* request,
113 const net::HttpResponseHeaders* response_headers) = 0; 117 const net::HttpResponseHeaders* response_headers) = 0;
114 }; 118 };
115 119
116 } // namespace android_webview 120 } // namespace android_webview
117 121
118 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ 122 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698