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

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

Issue 1852513003: Convert //android_webview to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git is hard Created 4 years, 8 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <string> 11 #include <string>
11 12
12 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
13 #include "base/memory/scoped_ptr.h"
14 14
15 class GURL; 15 class GURL;
16 16
17 namespace net { 17 namespace net {
18 class HttpResponseHeaders; 18 class HttpResponseHeaders;
19 class URLRequest; 19 class URLRequest;
20 } 20 }
21 21
22 namespace android_webview { 22 namespace android_webview {
23 23
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 virtual bool PendingAssociation() const = 0; 56 virtual bool PendingAssociation() const = 0;
57 57
58 // Retrieve CacheMode setting value of this AwContents. 58 // Retrieve CacheMode setting value of this AwContents.
59 // This method is called on the IO thread only. 59 // This method is called on the IO thread only.
60 virtual CacheMode GetCacheMode() const = 0; 60 virtual CacheMode GetCacheMode() const = 0;
61 61
62 // This will attempt to fetch the AwContentsIoThreadClient for the given 62 // This will attempt to fetch the AwContentsIoThreadClient for the given
63 // |render_process_id|, |render_frame_id| pair. 63 // |render_process_id|, |render_frame_id| pair.
64 // This method can be called from any thread. 64 // This method can be called from any thread.
65 // An empty scoped_ptr is a valid return value. 65 // An empty scoped_ptr is a valid return value.
66 static scoped_ptr<AwContentsIoThreadClient> FromID(int render_process_id, 66 static std::unique_ptr<AwContentsIoThreadClient> FromID(int render_process_id,
67 int render_frame_id); 67 int render_frame_id);
68 68
69 // Returns the global thread client for service worker related callbacks. 69 // Returns the global thread client for service worker related callbacks.
70 // An empty scoped_ptr is a valid return value. 70 // An empty scoped_ptr is a valid return value.
71 static scoped_ptr<AwContentsIoThreadClient> GetServiceWorkerIoThreadClient(); 71 static std::unique_ptr<AwContentsIoThreadClient>
72 GetServiceWorkerIoThreadClient();
72 73
73 // Called on the IO thread when a subframe is created. 74 // Called on the IO thread when a subframe is created.
74 static void SubFrameCreated(int render_process_id, 75 static void SubFrameCreated(int render_process_id,
75 int parent_render_frame_id, 76 int parent_render_frame_id,
76 int child_render_frame_id); 77 int child_render_frame_id);
77 78
78 // This method is called on the IO thread only. 79 // This method is called on the IO thread only.
79 typedef base::Callback<void(scoped_ptr<AwWebResourceResponse>)> 80 typedef base::Callback<void(std::unique_ptr<AwWebResourceResponse>)>
80 ShouldInterceptRequestResultCallback; 81 ShouldInterceptRequestResultCallback;
81 virtual void ShouldInterceptRequestAsync( 82 virtual void ShouldInterceptRequestAsync(
82 const net::URLRequest* request, 83 const net::URLRequest* request,
83 const ShouldInterceptRequestResultCallback callback) = 0; 84 const ShouldInterceptRequestResultCallback callback) = 0;
84 85
85 // Retrieve the AllowContentAccess setting value of this AwContents. 86 // Retrieve the AllowContentAccess setting value of this AwContents.
86 // This method is called on the IO thread only. 87 // This method is called on the IO thread only.
87 virtual bool ShouldBlockContentUrls() const = 0; 88 virtual bool ShouldBlockContentUrls() const = 0;
88 89
89 // Retrieve the AllowFileAccess setting value of this AwContents. 90 // Retrieve the AllowFileAccess setting value of this AwContents.
(...skipping 29 matching lines...) Expand all
119 120
120 // Called when a response from the server is received with status code >= 400. 121 // Called when a response from the server is received with status code >= 400.
121 virtual void OnReceivedHttpError( 122 virtual void OnReceivedHttpError(
122 const net::URLRequest* request, 123 const net::URLRequest* request,
123 const net::HttpResponseHeaders* response_headers) = 0; 124 const net::HttpResponseHeaders* response_headers) = 0;
124 }; 125 };
125 126
126 } // namespace android_webview 127 } // namespace android_webview
127 128
128 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ 129 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_
OLDNEW
« no previous file with comments | « android_webview/browser/aw_contents_client_bridge_base.h ('k') | android_webview/browser/aw_cookie_access_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698